• Johannes Berg's avatar
    [MAC80211]: avoid copying packets to interfaces that are down · 2a8a9a88
    Johannes Berg authored
    David Woodhouse noticed that under some circumstances the number of slab
    allocations kept growing. After looking a bit, this seemed to happen
    when you had a management mode interface that was *down*.
    
    The reason for this is that when the device is down, all management
    frames get queued to the in-kernel MLME (via ieee80211_sta_rx_mgmt) but
    then the sta work is invoked but doesn't run when the netif is down.
    When you then bring the interface up, all such frames are freed, but if
    you change the mode all of them are lost because the skb queue is
    reinitialised as soon as you go back to managed mode. The skb queue is
    correctly cleared when the interface is brought down, but the code
    doesn't account for the fact that it may be filled while it is not up.
    
    This patch should fix the issue by simply ignoring all interfaces that
    are down when going through the RX handlers.
    Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
    Acked-by: default avatarMichael Wu <flamingice@sourmilk.net>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2a8a9a88
ieee80211.c 42.7 KB