diff mbox series

mac80211: Clear beacon_int in ieee80211_do_stop

Message ID 1540327012-8371-1-git-send-email-greearb@candelatech.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series mac80211: Clear beacon_int in ieee80211_do_stop | expand

Commit Message

Ben Greear Oct. 23, 2018, 8:36 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

This fixes stale beacon-int values that would keep a netdev
from going up.

To reproduce:

Create two VAP on one radio.
vap1 has beacon-int 100, start it.
vap2 has beacon-int 240, start it (and it will fail
  because beacon-int mismatch).
reconfigure vap2 to have beacon-int 100 and start it.
  It will fail because the stale beacon-int 240 will be used
  in the ifup path and hostapd never gets a chance to set the
  new beacon interval.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/iface.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 90a59ce..f699cc84 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1059,6 +1059,8 @@  static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 	if (local->open_count == 0)
 		ieee80211_clear_tx_pending(local);
 
+	sdata->vif.bss_conf.beacon_int = 0;
+
 	/*
 	 * If the interface goes down while suspended, presumably because
 	 * the device was unplugged and that happens before our resume,