aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-12-14 10:47:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-26 02:24:39 -0500
commitbab10a549fd64e36f06c995d6adf22c0413e9379 (patch)
tree495dedc138ca26bf2628c5cac8734a0a0bf163a8 /net/mac80211
parentbeecb1e72cc5af0921c9daf75c404408744822cd (diff)
mac80211: implement multicast forwarding on fast-RX path
commit eeb0d56fab4cd7848cf2be6704fa48900dbc1381 upstream. In AP (or VLAN) mode, when unicast 802.11 packets are received, they might actually be multicast after conversion. In this case the fast-RX path didn't handle them properly to send them back to the wireless medium. Implement that by copying the SKB and sending it back out. The possible alternative would be to just punt the packet back to the regular (slow) RX path, but since we have almost all of the required code here already it's not so complicated to add here. Punting it back would also mean acquiring the spinlock, which would be bad for the stated purpose of the fast-RX path, to enable well-performing parallel RX. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rx.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a47bbc973f2d..2384b4aae064 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3939,21 +3939,31 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
3939 u64_stats_update_end(&stats->syncp); 3939 u64_stats_update_end(&stats->syncp);
3940 3940
3941 if (fast_rx->internal_forward) { 3941 if (fast_rx->internal_forward) {
3942 struct sta_info *dsta = sta_info_get(rx->sdata, skb->data); 3942 struct sk_buff *xmit_skb = NULL;
3943 bool multicast = is_multicast_ether_addr(skb->data);
3943 3944
3944 if (dsta) { 3945 if (multicast) {
3946 xmit_skb = skb_copy(skb, GFP_ATOMIC);
3947 } else if (sta_info_get(rx->sdata, skb->data)) {
3948 xmit_skb = skb;
3949 skb = NULL;
3950 }
3951
3952 if (xmit_skb) {
3945 /* 3953 /*
3946 * Send to wireless media and increase priority by 256 3954 * Send to wireless media and increase priority by 256
3947 * to keep the received priority instead of 3955 * to keep the received priority instead of
3948 * reclassifying the frame (see cfg80211_classify8021d). 3956 * reclassifying the frame (see cfg80211_classify8021d).
3949 */ 3957 */
3950 skb->priority += 256; 3958 xmit_skb->priority += 256;
3951 skb->protocol = htons(ETH_P_802_3); 3959 xmit_skb->protocol = htons(ETH_P_802_3);
3952 skb_reset_network_header(skb); 3960 skb_reset_network_header(xmit_skb);
3953 skb_reset_mac_header(skb); 3961 skb_reset_mac_header(xmit_skb);
3954 dev_queue_xmit(skb); 3962 dev_queue_xmit(xmit_skb);
3955 return true;
3956 } 3963 }
3964
3965 if (!skb)
3966 return true;
3957 } 3967 }
3958 3968
3959 /* deliver to local stack */ 3969 /* deliver to local stack */