From: Johannes Berg <johannes@sipsolutions.net>
To: Denis Kenzior <denkenz@gmail.com>, linux-wireless@vger.kernel.org
Subject: Re: [RFC] nl80211: Allow GET_INTERFACE dumps to be filtered
Date: Wed, 06 Jul 2016 14:30:52 +0200 [thread overview]
Message-ID: <1467808252.5460.1.camel@sipsolutions.net> (raw)
In-Reply-To: <1467334294-6384-1-git-send-email-denkenz@gmail.com> (sfid-20160630_185128_850366_B817D4E2)
On Thu, 2016-06-30 at 19:51 -0500, Denis Kenzior wrote:
> This patch allows GET_INTERFACE dumps to be filtered based on
> NL80211_ATTR_WIPHY or NL80211_ATTR_WDEV. The documentation for
> GET_INTERFACE mentions that this is possible:
> "Request an interface's configuration; either a dump request on
> a %NL80211_ATTR_WIPHY or ..."
>
> However, this behavior has not been implemented until now.
> ---
> net/wireless/nl80211.c | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 244d552..24cb4d9 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -2515,15 +2515,47 @@ static int nl80211_send_iface(struct sk_buff
> *msg, u32 portid, u32 seq, int flag
> return -EMSGSIZE;
> }
>
> +static int nl80211_dump_interface_parse(struct sk_buff *skb,
> + struct netlink_callback *cb,
> + int *filter_wiphy)
> +{
> + struct nlattr **tb = nl80211_fam.attrbuf;
> + int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN +
> nl80211_fam.hdrsize,
> + tb, nl80211_fam.maxattr,
> nl80211_policy);
> + /* ignore parse errors for backward compatibility */
> + if (ret)
> + return 0;
> +
> + if (tb[NL80211_ATTR_WIPHY])
> + *filter_wiphy = nla_get_u32(tb[NL80211_ATTR_WIPHY]);
> + if (tb[NL80211_ATTR_WDEV])
> + *filter_wiphy = nla_get_u64(tb[NL80211_ATTR_WDEV])
> >> 32;
The whole ret thing seems a bit pointless since you check the tb[], but
I guess it's better to be explicit.
Looks fine.
johannes
next prev parent reply other threads:[~2016-07-06 12:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-01 0:51 [RFC] nl80211: Allow GET_INTERFACE dumps to be filtered Denis Kenzior
2016-07-06 12:30 ` Johannes Berg [this message]
2016-07-06 15:28 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467808252.5460.1.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=denkenz@gmail.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.