Skip to content

Commit

Permalink
batman-adv: check for more types of invalid IP addresses in DAT
Browse files Browse the repository at this point in the history
There are more types of IP addresses that may appear in ARP packets that we
don't want to process. While some of these should never appear in sane ARP
packets, a 0.0.0.0 source is used for duplicate address detection and thus seen
quite often.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  • Loading branch information
Matthias Schiffer authored and Antonio Quartulli committed Jan 27, 2013
1 parent 0d15bec commit 757dd82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/batman-adv/distributed-arp-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,9 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
ip_src = batadv_arp_ip_src(skb, hdr_size);
ip_dst = batadv_arp_ip_dst(skb, hdr_size);
if (ipv4_is_loopback(ip_src) || ipv4_is_multicast(ip_src) ||
ipv4_is_loopback(ip_dst) || ipv4_is_multicast(ip_dst))
ipv4_is_loopback(ip_dst) || ipv4_is_multicast(ip_dst) ||
ipv4_is_zeronet(ip_src) || ipv4_is_lbcast(ip_src) ||
ipv4_is_zeronet(ip_dst) || ipv4_is_lbcast(ip_dst))
goto out;

type = ntohs(arphdr->ar_op);
Expand Down

0 comments on commit 757dd82

Please sign in to comment.