• Felix Fietkau's avatar
    wifi: mac80211: fix and simplify unencrypted drop check for mesh · 94b9b9de
    Felix Fietkau authored
    
    
    ieee80211_drop_unencrypted is called from ieee80211_rx_h_mesh_fwding and
    ieee80211_frame_allowed.
    
    Since ieee80211_rx_h_mesh_fwding can forward packets for other mesh nodes
    and is called earlier, it needs to check the decryptions status and if the
    packet is using the control protocol on its own, instead of deferring to
    the later call from ieee80211_frame_allowed.
    
    Because of that, ieee80211_drop_unencrypted has a mesh specific check
    that skips over the mesh header in order to check the payload protocol.
    This code is invalid when called from ieee80211_frame_allowed, since that
    happens after the 802.11->802.3 conversion.
    
    Fix this by moving the mesh specific check directly into
    ieee80211_rx_h_mesh_fwding.
    Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
    Link: https://lore.kernel.org/r/20221201135730.19723-1-nbd@nbd.name
    
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    94b9b9de
rx.c 147 KB