Search Linux Wireless

__ieee80211_rx_handle_packet problem with multiple vifs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index ac205a3..521b086 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -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;
+                               }
                        }
                }
        }

--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux