Skip to content

Commit

Permalink
nl80211: Add SOCKET_OWNER support to START_AP
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Kenzior <denkenz@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Denis Kenzior authored and Johannes Berg committed Mar 29, 2018
1 parent 188c1b3 commit 466a306
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/uapi/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1966,6 +1966,8 @@ enum nl80211_commands {
* torn down when the socket is closed.
* If set during %NL80211_CMD_JOIN_MESH the mesh setup will be
* automatically torn down when the socket is closed.
* If set during %NL80211_CMD_START_AP the AP will be automatically
* disabled when the socket is closed.
*
* @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
* the TDLS link initiator.
Expand Down
1 change: 1 addition & 0 deletions net/wireless/ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,

err = rdev_stop_ap(rdev, dev);
if (!err) {
wdev->conn_owner_nlportid = 0;
wdev->beacon_interval = 0;
memset(&wdev->chandef, 0, sizeof(wdev->chandef));
wdev->ssid_len = 0;
Expand Down
3 changes: 3 additions & 0 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -4134,6 +4134,9 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
wdev->chandef = params.chandef;
wdev->ssid_len = params.ssid_len;
memcpy(wdev->ssid, params.ssid, wdev->ssid_len);

if (info->attrs[NL80211_ATTR_SOCKET_OWNER])
wdev->conn_owner_nlportid = info->snd_portid;
}
wdev_unlock(wdev);

Expand Down

0 comments on commit 466a306

Please sign in to comment.