Skip to content

Commit f38dd58

Browse files
egrumbachjmberg-intel
authored andcommitted
cfg80211: don't add p2p device while in RFKILL
Since P2P device doesn't have a netdev associated to it, we cannot prevent the user to start it when in RFKILL. So refuse to even add it when in RFKILL. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent a754055 commit f38dd58

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎net/wireless/core.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
958958
case NETDEV_PRE_UP:
959959
if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
960960
return notifier_from_errno(-EOPNOTSUPP);
961-
if (rfkill_blocked(rdev->rfkill))
962-
return notifier_from_errno(-ERFKILL);
963961
ret = cfg80211_can_add_interface(rdev, wdev->iftype);
964962
if (ret)
965963
return notifier_from_errno(ret);

‎net/wireless/core.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ static inline int
411411
cfg80211_can_add_interface(struct cfg80211_registered_device *rdev,
412412
enum nl80211_iftype iftype)
413413
{
414+
if (rfkill_blocked(rdev->rfkill))
415+
return -ERFKILL;
416+
414417
return cfg80211_can_change_interface(rdev, NULL, iftype);
415418
}
416419

0 commit comments

Comments
 (0)