aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-04-17 02:34:51 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-04-18 01:12:10 +0000
commit9f20a4ebf044eb0cab83397c83f13bb3958abf6a (patch)
treebbd5fbf1fb60fe64c81556dc17c842062469b4a0
parentdc886a4428712aa4fcdcf8cd9e850b048c923bbf (diff)
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 89395f2f98b8..b9528295ad8e 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2013,12 +2013,23 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni,
* make sure we do not do it on every beacon we still may
* get so only do if something changed. vif->bss_conf.dtim_period
* should be 0 as we start up (we also reset it on teardown).
+ *
+ * If we are assoc we need to make sure dtim_period is non-0.
+ * 0 is a reserved value and drivers assume they can DIV by it.
+ * In theory this means we need to wait for the first beacon
+ * before we finalize the vif being assoc. In practise that
+ * is harder until net80211 learns how to. Work around like
+ * this for the moment.
*/
- if (vif->cfg.assoc &&
- vif->bss_conf.dtim_period != ni->ni_dtim_period &&
- ni->ni_dtim_period > 0) {
- vif->bss_conf.dtim_period = ni->ni_dtim_period;
- bss_changed |= BSS_CHANGED_BEACON_INFO;
+ if (vif->cfg.assoc) {
+ if (vif->bss_conf.dtim_period != ni->ni_dtim_period &&
+ ni->ni_dtim_period > 0) {
+ vif->bss_conf.dtim_period = ni->ni_dtim_period;
+ bss_changed |= BSS_CHANGED_BEACON_INFO;
+ } else if (vif->bss_conf.dtim_period == 0) {
+ vif->bss_conf.dtim_period = 1;
+ bss_changed |= BSS_CHANGED_BEACON_INFO;
+ }
}
vif->bss_conf.sync_dtim_count = ni->ni_dtim_count;