Skip to contentSkip to conversation

enable locked port feature with learning

PATCH In review Hans Schultz 2 participants 3 messages Jun 30, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover enable locked port feature with learning

This patch is related to the patch set "Add support for locked bridge ports (for 802.1X)"

This patch makes the locked port feature work with learning turned on, which is enabled with the command:

bridge link set dev DEV learning on

Without this patch, multicast packets like EAPOL packets will create a fdb entry when ingressing on a locked port with learning turned on, thus unintentionally opening up the port for traffic for the said MAC.

Some switchcore features like Mac-Auth and refreshing of FDB entries, require learning enables on some switchcores, f.ex. the mv88e6xxx family. Other features may apply too.

Since many switchcores trap or mirror various multicast packets to the CPU, they will unintentionally unlock the port for the SA mac in question unless prevented by this patch.

Hans Schultz (1):
net: bridge: ensure that multicast packets cannot unlock a locked port

 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/1 net: bridge: ensure that multicast packets cannot unlock a locked port

This makes it possible to use the locked port feature with learning turned on which is needed for various driver features.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_input.c +1 -0
index 68b3e850bcb9..a3ce0a151817 100644
@@ -215,6 +215,7 @@ static void __br_handle_local_finish(struct sk_buff *skb)
 	if ((p->flags & BR_LEARNING) &&
 	    nbp_state_should_learn(p) &&
 	    !br_opt_get(p->br, BROPT_NO_LL_LEARN) &&
+	    !(p->flags & BR_PORT_LOCKED) &&
 	    br_should_learn(p, skb, &vid))
 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, 0);
 }
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH net-next v1 1/1] net: bridge: ensure that multicast packets cannot unlock a locked port

Quoted 13 lines · Hans Schultz

This makes it possible to use the locked port feature with learning turned on which is needed for various driver features.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_input.c +0 -0
index 68b3e850bcb9..a3ce0a151817 100644

net/bridge/br_input.c static void __br_handle_local_finish(struct sk_buff *skb) · line 221

Quoted 7 lines
net/bridge/br_input.c +1 -0
@@ -215,6 +215,7 @@ static void __br_handle_local_finish(struct sk_buff *skb)
 	if ((p->flags & BR_LEARNING) &&
 	    nbp_state_should_learn(p) &&
 	    !br_opt_get(p->br, BROPT_NO_LL_LEARN) &&
+	    !(p->flags & BR_PORT_LOCKED) &&
 	    br_should_learn(p, skb, &vid))
 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, 0);
 }

hmm this is called for link-local traffic (01:80:c2), the title is misleading please include the real traffic type because it doesn't concern mcast

Also please include the long explanation from the 0 patch in this one and drop the cover letter, it's good to have the info.

Thanks,
Nik