Ticket #835: keyix-reset-conservative.diff

File keyix-reset-conservative.diff, 1.1 kB (added by matt@mattb.net.nz, 6 years ago)

Conservative (but untidier) approach to solving the problem that doesn't ignore refcounter

  • net80211/ieee80211_node.c

    old new  
    5050 
    5151#include <net80211/ieee80211_var.h> 
    5252#include <net80211/if_athproto.h> 
     53#include <ath/if_athvar.h> 
    5354 
    5455/* 
    5556 * Association id's are managed with a bit vector. 
     
    14701471        struct ieee80211vap *match) 
    14711472{ 
    14721473        struct ieee80211_node *ni, *next; 
     1474        u_int16_t keyix; 
    14731475 
    14741476        IEEE80211_NODE_LOCK_IRQ(nt); 
    14751477        TAILQ_FOREACH_SAFE(ni, &nt->nt_node, ni_list, next) { 
     
    14831485                        if (vap->iv_aid_bitmap != NULL) 
    14841486                                IEEE80211_AID_CLR(vap, ni->ni_associd); 
    14851487                } 
     1488                /* Remove the node from the key->node mapping if necessary */ 
     1489                keyix = ni->ni_ucastkey.wk_keyix; 
     1490                if (keyix != IEEE80211_KEYIX_NONE) { 
     1491                        struct ath_softc *sc = ni->ni_vap->iv_ic->ic_dev->priv; 
     1492                        if (sc->sc_keyixmap[keyix]!=NULL) { 
     1493                                ieee80211_free_node((struct ieee80211_node *) 
     1494                                        sc->sc_keyixmap[keyix]);  
     1495                                sc->sc_keyixmap[keyix] = NULL; 
     1496                        } 
     1497                } 
    14861498                node_reclaim(nt, ni); 
    14871499        } 
    14881500        IEEE80211_NODE_UNLOCK_IRQ(nt);