Search Linux Wireless

[PATCH] nl80211: fix p2p go mgmt send failure on DFS channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Start Autonomous p2p GO on DFS channel and then trigger remote
p2p peer to connect to p2p GO. P2P remote device will send
P2P provision discovery request action frame to P2P GO on GO's
home channel - DFS. But when P2P GO sends Provision discovery
response action frame to P2P remote, Kernel rejects the mgmt
frame sending since Kernel doesn't allow "offchan" tx mgmt when
AP interface is active on DFS channel.

Fix by allow "offchan" tx mgmt if the requested channel is same
or compatible with AP's home channel.

Signed-off-by: Liangwei Dong <liangwei@xxxxxxxxxxxxxx>
---
 net/wireless/nl80211.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 3d27b24c68b2..f33fd923bb19 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10807,6 +10807,7 @@ static int nl80211_tx_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];
 	struct cfg80211_chan_def chandef;
+	const struct cfg80211_chan_def *compat_chandef;
 	int err;
 	void *hdr = NULL;
 	u64 cookie;
@@ -10874,9 +10875,15 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 		return -EINVAL;
 
 	wdev_lock(wdev);
-	if (params.offchan && !cfg80211_off_channel_oper_allowed(wdev)) {
-		wdev_unlock(wdev);
-		return -EBUSY;
+	if (params.offchan &&
+	    !cfg80211_off_channel_oper_allowed(wdev) &&
+	    !cfg80211_chandef_identical(&wdev->chandef, &chandef)) {
+		compat_chandef = cfg80211_chandef_compatible(&wdev->chandef,
+							     &chandef);
+		if (compat_chandef != &chandef) {
+			wdev_unlock(wdev);
+			return -EBUSY;
+		}
 	}
 	wdev_unlock(wdev);
 
-- 
2.26.2



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux