Skip to contentSkip to conversation

bonding: Verify RX LACPDU has proper dest mac-addr

PATCH In review Mahesh Bandewar 2 participants 2 messages Feb 24, 2015

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

PATCH 1/2 bonding: Verify RX LACPDU has proper dest mac-addr

The 802.1AX standard states:
"The DA in LACPDUs is the Slow_Protocols_Multicast address."

This patch enforces that and drops LACPDUs with destination MAC addresses other than Slow_Protocols_Multicast address

---
 drivers/net/bonding/bond_3ad.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/bonding/bond_3ad.c +3 -0
index cfc4a9c1000a..9b436696b95e 100644
@@ -2485,6 +2485,9 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
 	if (skb->protocol != PKT_TYPE_LACPDU)
 		return RX_HANDLER_ANOTHER;
 
+	if (!MAC_ADDRESS_EQUAL(eth_hdr(skb)->h_dest, lacpdu_mcast_addr))
+		return RX_HANDLER_ANOTHER;
+
 	lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu);
 	if (!lacpdu)
 		return RX_HANDLER_ANOTHER;
Signature · 1 line
2.2.0.rc0.207.ga3a616c
Reviewed-by on v1 1/2
#1 lore raw
Quoted 17 lines · Mahesh Bandewar

The 802.1AX standard states:
"The DA in LACPDUs is the Slow_Protocols_Multicast address."

This patch enforces that and drops LACPDUs with destination MAC addresses other than Slow_Protocols_Multicast address

---
 drivers/net/bonding/bond_3ad.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/bonding/bond_3ad.c +0 -0
index cfc4a9c1000a..9b436696b95e 100644

drivers/net/bonding/bond_3ad.c int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, · line 2493

Quoted 9 lines
drivers/net/bonding/bond_3ad.c +3 -0
@@ -2485,6 +2485,9 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
 	if (skb->protocol != PKT_TYPE_LACPDU)
 		return RX_HANDLER_ANOTHER;
 
+	if (!MAC_ADDRESS_EQUAL(eth_hdr(skb)->h_dest, lacpdu_mcast_addr))
+		return RX_HANDLER_ANOTHER;
+
 	lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu);
 	if (!lacpdu)
 		return RX_HANDLER_ANOTHER;