aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-03-10 18:00:45 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-03-10 18:00:45 +0000
commit0f6ddd5116b7aa15b2893e168f1a354f13ff0929 (patch)
tree79fa09c759473b32bf1ae05d97a5222b0a93242e /package
parentef12d2ba03f82c0d0d19a79058b1a577c4293a10 (diff)
downloadupstream-0f6ddd5116b7aa15b2893e168f1a354f13ff0929.tar.gz
upstream-0f6ddd5116b7aa15b2893e168f1a354f13ff0929.tar.bz2
upstream-0f6ddd5116b7aa15b2893e168f1a354f13ff0929.zip
mac80211: redirect EAP frames on AP VLAN interfaces to the main AP interface to fix a bridging related race condition
SVN-Revision: 26016
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/patches/580-mac80211_redirect_vlan_eap_frames.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/package/mac80211/patches/580-mac80211_redirect_vlan_eap_frames.patch b/package/mac80211/patches/580-mac80211_redirect_vlan_eap_frames.patch
new file mode 100644
index 0000000000..03a4fe5d37
--- /dev/null
+++ b/package/mac80211/patches/580-mac80211_redirect_vlan_eap_frames.patch
@@ -0,0 +1,67 @@
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -1582,7 +1582,7 @@ ieee80211_drop_unencrypted_mgmt(struct i
+ }
+
+ static int
+-__ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
++__ieee80211_data_to_8023(struct ieee80211_rx_data *rx, bool *port_control)
+ {
+ struct ieee80211_sub_if_data *sdata = rx->sdata;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
+@@ -1590,6 +1590,7 @@ __ieee80211_data_to_8023(struct ieee8021
+ struct ethhdr *ehdr;
+ int ret;
+
++ *port_control = false;
+ if (ieee80211_has_a4(hdr->frame_control) &&
+ sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->u.vlan.sta)
+ return -1;
+@@ -1608,11 +1609,14 @@ __ieee80211_data_to_8023(struct ieee8021
+ return -1;
+
+ ret = ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
+- if (ret < 0 || !check_port_control)
++ if (ret < 0)
+ return ret;
+
+ ehdr = (struct ethhdr *) rx->skb->data;
+- if (ehdr->h_proto != rx->sdata->control_port_protocol)
++ if (ehdr->h_proto == rx->sdata->control_port_protocol)
++ *port_control = true;
++
++ if (check_port_control && !*port_control)
+ return -1;
+
+ return 0;
+@@ -1913,6 +1917,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_
+ struct net_device *dev = sdata->dev;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
+ __le16 fc = hdr->frame_control;
++ bool port_control;
+ int err;
+
+ if (unlikely(!ieee80211_is_data(hdr->frame_control)))
+@@ -1929,13 +1934,21 @@ ieee80211_rx_h_data(struct ieee80211_rx_
+ sdata->vif.type == NL80211_IFTYPE_AP)
+ return RX_DROP_MONITOR;
+
+- err = __ieee80211_data_to_8023(rx);
++ err = __ieee80211_data_to_8023(rx, &port_control);
+ if (unlikely(err))
+ return RX_DROP_UNUSABLE;
+
+ if (!ieee80211_frame_allowed(rx, fc))
+ return RX_DROP_MONITOR;
+
++ if (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
++ unlikely(port_control) && sdata->bss) {
++ sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
++ u.ap);
++ dev = sdata->dev;
++ rx->sdata = sdata;
++ }
++
+ rx->skb->dev = dev;
+
+ dev->stats.rx_packets++;