On Wed, Sep 10, 2014 at 12:27:05PM -0500, Kent R. Spillner wrote: > On Wed, Sep 10, 2014 at 02:42:43PM +0200, Marcin Piotr Pawlowski wrote: > > Yes, I think that it could be is possible to double clean the node cache. > > > > Updated diff with suggestion from Stefan. > > ok kspillner@, but would prefer a better name than ieee80211_clean_cached. :) > Perhaps ieee80211_purge_cache?
I think ieee80211_clean_cached() is fine. The function only removes notes in CACHE state. These are nodes that are "visible" but haven't otherwise interacted with us. There are additional states, all of which refer to nodes which are part of the node cache (so perhaps IEEE80211_STA_CACHE is a misleading name): enum ieee80211_node_state { IEEE80211_STA_CACHE, /* cached node */ IEEE80211_STA_BSS, /* ic->ic_bss, the network we joined */ IEEE80211_STA_AUTH, /* successfully authenticated */ IEEE80211_STA_ASSOC, /* successfully associated */ IEEE80211_STA_COLLECT /* This node remains in the cache while * the driver sends a de-auth message; * afterward it should be freed to make room * for a new node. */ }; To me, the name ieee80211_purge_cache() would imply that all nodes were removed regardless of the state they're in.