Skip to content

Commit 178e9d6

Browse files
committed
wifi: mac80211: fix unsolicited broadcast probe config
There's a bug in ieee80211_set_unsol_bcast_probe_resp(), it tries to return BSS_CHANGED_UNSOL_BCAST_PROBE_RESP (which has the value 1<<31) in an int, which makes it negative and considered an error. Fix this by passing the changed flags to set separately. Fixes: 3b1c256 ("wifi: mac80211: fixes in FILS discovery updates") Reviewed-by: Jeff Johnson <[email protected]> Link: https://msgid.link/20240129195729.965b0740bf80.I6bc6f5236863f686c17d689be541b1dd2633c417@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 86b2dac commit 178e9d6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

net/mac80211/cfg.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Copyright 2006-2010 Johannes Berg <[email protected]>
66
* Copyright 2013-2015 Intel Mobile Communications GmbH
77
* Copyright (C) 2015-2017 Intel Deutschland GmbH
8-
* Copyright (C) 2018-2022 Intel Corporation
8+
* Copyright (C) 2018-2024 Intel Corporation
99
*/
1010

1111
#include <linux/ieee80211.h>
@@ -987,7 +987,8 @@ static int
987987
ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata,
988988
struct cfg80211_unsol_bcast_probe_resp *params,
989989
struct ieee80211_link_data *link,
990-
struct ieee80211_bss_conf *link_conf)
990+
struct ieee80211_bss_conf *link_conf,
991+
u64 *changed)
991992
{
992993
struct unsol_bcast_probe_resp_data *new, *old = NULL;
993994

@@ -1011,7 +1012,8 @@ ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata,
10111012
RCU_INIT_POINTER(link->u.ap.unsol_bcast_probe_resp, NULL);
10121013
}
10131014

1014-
return BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
1015+
*changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP;
1016+
return 0;
10151017
}
10161018

10171019
static int ieee80211_set_ftm_responder_params(
@@ -1450,10 +1452,9 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
14501452

14511453
err = ieee80211_set_unsol_bcast_probe_resp(sdata,
14521454
&params->unsol_bcast_probe_resp,
1453-
link, link_conf);
1455+
link, link_conf, &changed);
14541456
if (err < 0)
14551457
goto error;
1456-
changed |= err;
14571458

14581459
err = drv_start_ap(sdata->local, sdata, link_conf);
14591460
if (err) {
@@ -1525,10 +1526,9 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
15251526

15261527
err = ieee80211_set_unsol_bcast_probe_resp(sdata,
15271528
&params->unsol_bcast_probe_resp,
1528-
link, link_conf);
1529+
link, link_conf, &changed);
15291530
if (err < 0)
15301531
return err;
1531-
changed |= err;
15321532

15331533
if (beacon->he_bss_color_valid &&
15341534
beacon->he_bss_color.enabled != link_conf->he_bss_color.enabled) {

0 commit comments

Comments
 (0)