Skip to content

Commit

Permalink
wifi: cfg80211: remove links only on AP
Browse files Browse the repository at this point in the history
Since links are only controlled by userspace via cfg80211
in AP mode, also only remove them from the driver in that
case.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
Link: https://lore.kernel.org/r/20230608163202.ed65b94916fa.I2458c46888284cc5ce30715fe642bc5fc4340c8f@changeid
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
jmberg-intel committed Jun 9, 2023
1 parent 15846f9 commit 34d4e3e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright 2007-2009 Johannes Berg <[email protected]>
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2017 Intel Deutschland GmbH
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*/
#include <linux/export.h>
#include <linux/bitops.h>
Expand Down Expand Up @@ -2558,6 +2558,13 @@ void cfg80211_remove_links(struct wireless_dev *wdev)
{
unsigned int link_id;

/*
* links are controlled by upper layers (userspace/cfg)
* only for AP mode, so only remove them here for AP
*/
if (wdev->iftype != NL80211_IFTYPE_AP)
return;

wdev_lock(wdev);
if (wdev->valid_links) {
for_each_valid_link(wdev, link_id)
Expand Down

0 comments on commit 34d4e3e

Please sign in to comment.