aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-18 14:43:58 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-01-18 14:43:58 +0000
commitb0d7e5ba2e0e67d25577b97e81c9b9a7a6a94234 (patch)
tree57050ed2e02769dc829df0f2e2a1a6c8c7830cb5 /package/mac80211/patches
parent77e56e4833f727660e75cfb2034793a57d6809f1 (diff)
downloadupstream-b0d7e5ba2e0e67d25577b97e81c9b9a7a6a94234.tar.gz
upstream-b0d7e5ba2e0e67d25577b97e81c9b9a7a6a94234.tar.bz2
upstream-b0d7e5ba2e0e67d25577b97e81c9b9a7a6a94234.zip
mac80211: rework wds sta fix - check for the protocol of the incoming frame instead of just the authorized state
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25039 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches')
-rw-r--r--package/mac80211/patches/560-mac80211_wds_sta_fix.patch36
1 files changed, 30 insertions, 6 deletions
diff --git a/package/mac80211/patches/560-mac80211_wds_sta_fix.patch b/package/mac80211/patches/560-mac80211_wds_sta_fix.patch
index a0418b6309..ba04a6fc3e 100644
--- a/package/mac80211/patches/560-mac80211_wds_sta_fix.patch
+++ b/package/mac80211/patches/560-mac80211_wds_sta_fix.patch
@@ -1,18 +1,42 @@
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -1561,9 +1561,13 @@ __ieee80211_data_to_8023(struct ieee8021
+@@ -1556,17 +1556,36 @@ __ieee80211_data_to_8023(struct ieee8021
+ {
+ struct ieee80211_sub_if_data *sdata = rx->sdata;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
++ bool check_port_control = false;
++ struct ethhdr *ehdr;
++ int ret;
+
+ if (ieee80211_has_a4(hdr->frame_control) &&
sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->u.vlan.sta)
return -1;
-+ if (!ieee80211_802_1x_port_control(rx) &&
-+ sdata->vif.type == NL80211_IFTYPE_STATION &&
-+ !!sdata->u.mgd.use_4addr != !!ieee80211_has_a4(hdr->frame_control))
-+ return -1;
++ if (sdata->vif.type == NL80211_IFTYPE_STATION &&
++ !!sdata->u.mgd.use_4addr != !!ieee80211_has_a4(hdr->frame_control)) {
++
++ if (!sdata->u.mgd.use_4addr)
++ return -1;
++ else
++ check_port_control = true;
++ }
+
if (is_multicast_ether_addr(hdr->addr1) &&
- ((sdata->vif.type == NL80211_IFTYPE_AP_VLAN && sdata->u.vlan.sta) ||
- (sdata->vif.type == NL80211_IFTYPE_STATION && sdata->u.mgd.use_4addr)))
+ sdata->vif.type == NL80211_IFTYPE_AP_VLAN && sdata->u.vlan.sta)
++ return -1;
++
++ ret = ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
++ if (ret < 0 || !check_port_control)
++ return ret;
++
++ ehdr = (struct ethhdr *) rx->skb->data;
++ if (ehdr->h_proto != rx->sdata->control_port_protocol)
return -1;
- return ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
+- return ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
++ return 0;
+ }
+
+ /*