diff options
author | Denis Kenzior <denkenz@gmail.com> | 2018-03-26 12:52:45 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-03-29 10:36:22 +0200 |
commit | f8d16d3edb4dbae080df04318423c360de3c594d (patch) | |
tree | b110456d132b2538a6533e3b249a8e5fa1b157b3 /net/wireless/nl80211.c | |
parent | 37b1c004685a3cea420dd96aa3803da627359f60 (diff) | |
download | linux-f8d16d3edb4dbae080df04318423c360de3c594d.tar.gz linux-f8d16d3edb4dbae080df04318423c360de3c594d.tar.bz2 linux-f8d16d3edb4dbae080df04318423c360de3c594d.zip |
nl80211: Add SOCKET_OWNER support to JOIN_IBSS
Signed-off-by: Denis Kenzior <denkenz@gmail.com>
[johannes: fix race with wdev lock/unlock by just acquiring once]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fe27ab443d01..13f7c002f562 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -8679,9 +8679,14 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) ibss.userspace_handles_dfs = nla_get_flag(info->attrs[NL80211_ATTR_HANDLE_DFS]); - err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); + wdev_lock(dev->ieee80211_ptr); + err = __cfg80211_join_ibss(rdev, dev, &ibss, connkeys); if (err) kzfree(connkeys); + else if (info->attrs[NL80211_ATTR_SOCKET_OWNER]) + dev->ieee80211_ptr->conn_owner_nlportid = info->snd_portid; + wdev_unlock(dev->ieee80211_ptr); + return err; } |