From dffc3e235360cd7b71261239ee8507b7d62a1471 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 16 Jul 2018 19:57:28 -0400 Subject: [PATCH] freebsd11_wlan: Drain ageq before cleaning it up. The comment above ieee80211_ageq_cleanup specifically notes that the queue is assumed to be empty, and in order to make it so, ieee80211_ageq_drain must be used. Possibly helps with #3180, as this might be a source of mbuf leakage. --- .../freebsd11_wlan/net80211/ieee80211_node.c | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libs/compat/freebsd11_wlan/net80211/ieee80211_node.c b/src/libs/compat/freebsd11_wlan/net80211/ieee80211_node.c index f3f918de7d..379f508463 100644 --- a/src/libs/compat/freebsd11_wlan/net80211/ieee80211_node.c +++ b/src/libs/compat/freebsd11_wlan/net80211/ieee80211_node.c @@ -30,13 +30,13 @@ __FBSDID("$FreeBSD: releng/11.1/sys/net80211/ieee80211_node.c 302018 2016-06-19 #include "opt_wlan.h" #include -#include -#include +#include +#include #include #include #include - + #include #include #include @@ -134,6 +134,9 @@ ieee80211_node_detach(struct ieee80211com *ic) callout_drain(&ic->ic_inact); ieee80211_node_table_cleanup(&ic->ic_sta); +#ifdef __HAIKU__ + ieee80211_ageq_drain(&ic->ic_stageq); +#endif ieee80211_ageq_cleanup(&ic->ic_stageq); } @@ -199,7 +202,7 @@ ieee80211_node_vdetach(struct ieee80211vap *vap) } } -/* +/* * Port authorize/unauthorize interfaces for use by an authenticator. */ @@ -370,7 +373,7 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct ieee80211_channel *chan) memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen); #endif } - /* + /* * Fix the channel and related attributes. */ /* clear DFS CAC state on previous channel */ @@ -550,7 +553,7 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee80211_node *ni) printf("%s\n", fail & 0x10 ? "!" : ""); } #endif /* IEEE80211_DEBUG */ - + int ieee80211_ibss_merge_check(struct ieee80211_node *ni) @@ -755,7 +758,7 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) * Set the erp state (mostly the slot time) to deal with * the auto-select case; this should be redundant if the * mode is locked. - */ + */ ieee80211_reset_erp(ic); ieee80211_wme_initparams(vap); @@ -1461,7 +1464,7 @@ ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, /* * In adhoc demo mode there are no management * frames to use to discover neighbor capabilities, - * so blindly propagate the local configuration + * so blindly propagate the local configuration * so we can do interesting things (e.g. use * WME to disable ACK's). */ @@ -2043,7 +2046,7 @@ timeout_stations(void *arg __unused, struct ieee80211_node *ni) /* XXX before inact decrement? */ if (ni == vap->iv_bss) return; - if (ni->ni_associd != 0 || + if (ni->ni_associd != 0 || (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO)) { /*