__ieee80211_rx_handle_packet problem with multiple vifs.
The __ieee80211_rx_handle_packet logic is broken when multiple
VIFS can receive the same data packet (ARP, for instance). It may have similar issues for non-data packets, but it seems it at least mostly works in that case.
The patch below makes it function better, but I suspect there are still bugs with this approach because prepare_for_handlers() is called with 'current' sta, but the packet may be processed for 'prev'.
I could make the logic more duplicated and take different code paths if prev exists, or I could re-call the prepare_for_handlers right before sending to invoke_rx_handlers.
Or maybe merge data and non-date loops into a single loop?
Any suggestions for preferred way to go about this?
Thanks,
Ben
net/mac80211/rx.c +13 -2
@@ -2657,8 +2657,19 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,if (status->flag &RX_FLAG_MMIC_ERROR ) {if (rx.flags &IEEE80211_RX_RA_MATCH )ieee80211_rx_michael_mic_report (hdr, &rx); - }else - prev = rx.sdata; + }else { +if (prev) { + skb_new =skb_copy (skb,GFP_ATOMIC ); +if (!skb_new) { +if (net_ratelimit ()) +wiphy_debug (local->hw.wiphy, + "failed to copy data frame for %s\n + prev->name); + }else +ieee80211_invoke_rx_handlers (prev, &rx, skb_new); + } + prev = sta->sdata; + } } } }
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com