Skip to contentSkip to conversation

mac80211: drop non-auth 3-addr data frames when running as a 4-addr station

PATCH Superseded Felix Fietkau 2 participants 3 messages Jan 15, 2011 – Jan 17, 2011 mac80211

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: drop non-auth 3-addr data frames when running as a 4-addr station

When running as a 4-addr station against an AP that has the 4-addr VLAN interface and the main 3-addr AP interface bridged together, sometimes frames originating from the station were looping back from the 3-addr AP interface, causing the bridge code to emit warnings about receiving frames with its own source address.
I'm not sure why this is happening yet, but I think it's a good idea to drop all frames (except 802.1x/EAP frames) that do not match the configured addressing mode, including 4-address frames sent to a 3-address station. User test reports indicate that the problem goes away with this patch.

---
 net/mac80211/rx.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
net/mac80211/rx.c +6 -2
index a6701ed..54e3108 100644
@@ -1561,9 +1561,13 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
 	    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 (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;
 
 	return ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
Signature · 1 line
1.7.3.2
maintainer
#1 lore raw
Quoted 20 lines · Felix Fietkau

When running as a 4-addr station against an AP that has the 4-addr VLAN interface and the main 3-addr AP interface bridged together, sometimes frames originating from the station were looping back from the 3-addr AP interface, causing the bridge code to emit warnings about receiving frames with its own source address.
I'm not sure why this is happening yet, but I think it's a good idea to drop all frames (except 802.1x/EAP frames) that do not match the configured addressing mode, including 4-address frames sent to a 3-address station. User test reports indicate that the problem goes away with this patch.

---
 net/mac80211/rx.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
net/mac80211/rx.c +0 -0
index a6701ed..54e3108 100644

net/mac80211/rx.c __ieee80211_data_to_8023(struct ieee80211_rx_data *rx) · line 1564

Quoted 4 lines
net/mac80211/rx.c +1 -0
@@ -1561,9 +1561,13 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
 	    sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->u.vlan.sta)
 		return -1;
 
+	if (!ieee80211_802_1x_port_control(rx) &&

I think you need a different check there. This just checks the STA is authorized.

johannes

#2 lore raw
Quoted 24 lines · Johannes Berg
Quoted 23 lines · Felix Fietkau

When running as a 4-addr station against an AP that has the 4-addr VLAN interface and the main 3-addr AP interface bridged together, sometimes frames originating from the station were looping back from the 3-addr AP interface, causing the bridge code to emit warnings about receiving frames with its own source address.
I'm not sure why this is happening yet, but I think it's a good idea to drop all frames (except 802.1x/EAP frames) that do not match the configured addressing mode, including 4-address frames sent to a 3-address station. User test reports indicate that the problem goes away with this patch.

---

  net/mac80211/rx.c |    8 ++++++--
  1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a6701ed..54e3108 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1561,9 +1561,13 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
sdata->vif.type == NL80211_IFTYPE_AP_VLAN&& !sdata->u.vlan.sta)
return -1;

Quoted 4 lines
Quoted 1 line

+ if (!ieee80211_802_1x_port_control(rx)&&

I think you need a different check there. This just checks the STA is authorized.

You're right. I'll fix and resend.

- Felix