linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: __ieee80211_rx_handle_packet problem with multiple vifs.
Date: Sun, 19 Sep 2010 23:42:37 -0700	[thread overview]
Message-ID: <4C97025D.9050006@candelatech.com> (raw)

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@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

                 reply	other threads:[~2010-09-20  6:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C97025D.9050006@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).