Node cache eviction is too agressive, possibly kicking off associated
stations for no good reason. I missed that associated stations are in
state IEEE80211_S_RUN rather than IEEE80211_S_ASSOC (which means "trying
to associate").

Also compile the debug message shown when a node is evicted from the
cache to make such problems easier to spot (won't affect install media
as it is protected by IEEE80211_STA_ONLY).

Index: ieee80211_node.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_node.c,v
retrieving revision 1.70
diff -u -p -r1.70 ieee80211_node.c
--- ieee80211_node.c    16 Jul 2012 14:51:46 -0000      1.70
+++ ieee80211_node.c    18 Jul 2012 10:24:59 -0000
@@ -1176,12 +1176,12 @@ ieee80211_clean_nodes(struct ieee80211co
                    ic->ic_state == IEEE80211_S_RUN) {
                        if (cache_timeout) {
                                if (ni->ni_state != IEEE80211_STA_COLLECT &&
-                                   (ni->ni_state == IEEE80211_STA_ASSOC ||
+                                   (ni->ni_state >= IEEE80211_STA_ASSOC ||
                                    ni->ni_inact < IEEE80211_INACT_MAX))
                                        continue;
                        } else {
                                if (ic->ic_opmode == IEEE80211_M_HOSTAP &&
-                                   ((ni->ni_state == IEEE80211_STA_ASSOC &&
+                                   ((ni->ni_state >= IEEE80211_STA_ASSOC &&
                                    ni->ni_inact < IEEE80211_INACT_MAX) ||
                                    (ni->ni_state == IEEE80211_STA_AUTH &&
                                     ni->ni_inact == 0)))
@@ -1194,9 +1194,10 @@ ieee80211_clean_nodes(struct ieee80211co
                                        continue;
                        }
                }
+               if (ifp->if_flags & IFF_DEBUG)
+                       printf("%s: station %s purged from node cache\n",
+                           ifp->if_xname, ether_sprintf(ni->ni_macaddr));
 #endif
-               DPRINTF(("station %s purged from LRU cache\n",
-                   ether_sprintf(ni->ni_macaddr)));
                /*
                 * If we're hostap and the node is authenticated, send
                 * a deauthentication frame. The node will be freed when

Reply via email to