From: Antonio Quartulli <ordex@autistici.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
Antonio Quartulli <antonio@open-mesh.com>
Subject: [PATCH] nl80211: allow to register for mgmt frames without a matching pattern
Date: Tue, 18 Jun 2013 14:29:14 +0200 [thread overview]
Message-ID: <1371558554-367-1-git-send-email-ordex@autistici.org> (raw)
From: Antonio Quartulli <antonio@open-mesh.com>
It may be the case that a user wants to register for any
frame of a particular type.
Allow this operation by passing null as matching pattern and
0 as pattern len when registering for the frame.
This is useful to wpa_supplicant when it wants to receive
any AUTH frame.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
net/wireless/nl80211.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e402819..878d346 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7099,9 +7099,11 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct wireless_dev *wdev = info->user_ptr[1];
u16 frame_type = IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION;
+ void *data = nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]);
+ int len = 0;
- if (!info->attrs[NL80211_ATTR_FRAME_MATCH])
- return -EINVAL;
+ if (data)
+ len = nla_len(data);
if (info->attrs[NL80211_ATTR_FRAME_TYPE])
frame_type = nla_get_u16(info->attrs[NL80211_ATTR_FRAME_TYPE]);
@@ -7125,8 +7127,7 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
return -EOPNOTSUPP;
return cfg80211_mlme_register_mgmt(wdev, info->snd_portid, frame_type,
- nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),
- nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]));
+ data, len);
}
static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
--
1.8.1.5
next reply other threads:[~2013-06-18 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 12:29 Antonio Quartulli [this message]
2013-06-18 12:32 ` [PATCH] nl80211: allow to register for mgmt frames without a matching pattern Johannes Berg
2013-06-18 12:42 ` Antonio Quartulli
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=1371558554-367-1-git-send-email-ordex@autistici.org \
--to=ordex@autistici.org \
--cc=antonio@open-mesh.com \
--cc=johannes@sipsolutions.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox