Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f75c8e1 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Simon Wunderlich
Browse files

batman-adv: Disallow mcast src address for data frames



The routing checks are validating the source mac address of the outer
ethernet header. They reject every source mac address which is a broadcast
address. But they also have to reject any multicast mac addresses.

Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
[sw@simonwunderlich.de: fix commit message typo]
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
parent 7d72d174
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -368,8 +368,8 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
	if (is_broadcast_ether_addr(ethhdr->h_dest))
		goto free_skb;

	/* packet with broadcast sender address */
	if (is_broadcast_ether_addr(ethhdr->h_source))
	/* packet with broadcast/multicast sender address */
	if (is_multicast_ether_addr(ethhdr->h_source))
		goto free_skb;

	/* not for me */
@@ -466,8 +466,8 @@ static int batadv_check_unicast_packet(struct batadv_priv *bat_priv,
	if (is_broadcast_ether_addr(ethhdr->h_dest))
		return -EBADR;

	/* packet with broadcast sender address */
	if (is_broadcast_ether_addr(ethhdr->h_source))
	/* packet with broadcast/multicast sender address */
	if (is_multicast_ether_addr(ethhdr->h_source))
		return -EBADR;

	/* not for me */
@@ -1159,8 +1159,8 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
	if (!is_broadcast_ether_addr(ethhdr->h_dest))
		goto free_skb;

	/* packet with broadcast sender address */
	if (is_broadcast_ether_addr(ethhdr->h_source))
	/* packet with broadcast/multicast sender address */
	if (is_multicast_ether_addr(ethhdr->h_source))
		goto free_skb;

	/* ignore broadcasts sent by myself */