From: Johannes Berg Date: Fri, 27 Jul 2007 13:43:22 +0000 (+0200) Subject: [MAC80211]: rx cleanups (2) X-Git-Tag: v2.6.24-rc1~1454^2~860 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=340e11f332c695c43f506e82b1d39d00716c5005;p=linux-2.6 [MAC80211]: rx cleanups (2) Some more outdenting to make the code more readable. Signed-off-by: Johannes Berg Signed-off-by: Jiri Benc Signed-off-by: John W. Linville --- diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index f255579dc5..95a00eb572 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1387,21 +1387,35 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, if (!prepres) continue; - if (prev) { - skb_new = skb_copy(skb, GFP_ATOMIC); - if (!skb_new) { - if (net_ratelimit()) - printk(KERN_DEBUG "%s: failed to copy " - "multicast frame for %s", - local->mdev->name, prev->dev->name); - continue; - } - rx.skb = skb_new; - rx.dev = prev->dev; - rx.sdata = prev; - ieee80211_invoke_rx_handlers(local, local->rx_handlers, - &rx, sta); + /* + * frame is destined for this interface, but if it's not + * also for the previous one we handle that after the + * loop to avoid copying the SKB once too much + */ + + if (!prev) { + prev = sdata; + continue; } + + /* + * frame was destined for the previous interface + * so invoke RX handlers for it + */ + + skb_new = skb_copy(skb, GFP_ATOMIC); + if (!skb_new) { + if (net_ratelimit()) + printk(KERN_DEBUG "%s: failed to copy " + "multicast frame for %s", + local->mdev->name, prev->dev->name); + continue; + } + rx.skb = skb_new; + rx.dev = prev->dev; + rx.sdata = prev; + ieee80211_invoke_rx_handlers(local, local->rx_handlers, + &rx, sta); prev = sdata; } if (prev) {