bonding: Verify RX LACPDU has proper dest mac-addr
authorMahesh Bandewar <maheshb@google.com>
Tue, 24 Feb 2015 01:50:10 +0000 (17:50 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Feb 2015 21:05:47 +0000 (16:05 -0500)
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

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_3ad.c

index cfc4a9c1000abb109e95c3d233405ef57febe5c1..9b436696b95ed51fd42e0a6f856bbc709c77fadf 100644 (file)
@@ -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;