Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=340e11f332c695c43f506e82b1d39d00716c5005
Commit:     340e11f332c695c43f506e82b1d39d00716c5005
Parent:     52865dfd520ddd3d1176947106759ff944f0f8af
Author:     Johannes Berg <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 27 15:43:22 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:47:32 2007 -0700

    [MAC80211]: rx cleanups (2)
    
    Some more outdenting to make the code more readable.
    
    Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
    Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 net/mac80211/rx.c |   42 ++++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f255579..95a00eb 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) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to