batman-adv: Disallow zero and mcast src address for mgmt frames
authorSven Eckelmann <sven@narfation.org>
Sat, 6 Aug 2016 15:04:22 +0000 (17:04 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Tue, 8 Nov 2016 18:02:35 +0000 (19:02 +0100)
The routing check for management frames is validating the source mac
address in the outer ethernet header. It rejects every source mac address
which is a broadcast address. But it also has to reject the zero-mac
address and multicast mac addresses.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/routing.c

index c02897ba9b8b8d52d0a3e13ba2447795034aaa58..4f034df09a5a799306976f6b09f1b72c65e25225 100644 (file)
@@ -196,8 +196,8 @@ bool batadv_check_management_packet(struct sk_buff *skb,
        if (!is_broadcast_ether_addr(ethhdr->h_dest))
                return false;
 
-       /* packet with broadcast sender address */
-       if (is_broadcast_ether_addr(ethhdr->h_source))
+       /* packet with invalid sender address */
+       if (!is_valid_ether_addr(ethhdr->h_source))
                return false;
 
        /* create a copy of the skb, if needed, to modify it. */