The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] nl80211: ignore the length of hide ssid is zero in scan
@ 2021-01-28 11:56 samirweng1979
  2021-01-28 11:59 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: samirweng1979 @ 2021-01-28 11:56 UTC (permalink / raw)
  To: johannes, davem, kuba; +Cc: linux-wireless, netdev, linux-kernel, wengjianfeng

From: wengjianfeng <wengjianfeng@yulong.com>

If the length of hide ssid is zero in scan, don't pass
it to driver, which doesn't make any sense.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
---
 net/wireless/nl80211.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 775d0c4..d62e2aa 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8727,6 +8727,9 @@ static int nl80211_abort_scan(struct sk_buff *skb, struct genl_info *info)
 				err = -EINVAL;
 				goto out_free;
 			}
+			/* ignore the length of hide ssid is zero */
+			if (nla_len(attr) == 0)
+				continue;
 			request->ssids[i].ssid_len = nla_len(attr);
 			memcpy(request->ssids[i].ssid, nla_data(attr),
 			       nla_len(attr));
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nl80211: ignore the length of hide ssid is zero in scan
  2021-01-28 11:56 [PATCH] nl80211: ignore the length of hide ssid is zero in scan samirweng1979
@ 2021-01-28 11:59 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2021-01-28 11:59 UTC (permalink / raw)
  To: samirweng1979, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, wengjianfeng

On Thu, 2021-01-28 at 19:56 +0800, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@yulong.com>
> 
> If the length of hide ssid is zero in scan, don't pass
> it to driver, which doesn't make any sense.

Err, please check again how scanning works. This is quite obviously
intentional.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-28 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28 11:56 [PATCH] nl80211: ignore the length of hide ssid is zero in scan samirweng1979
2021-01-28 11:59 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox