Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349286
b: refs/heads/master
c: b618ad1
h: refs/heads/master
v: v3
  • Loading branch information
Matthias Schiffer authored and Antonio Quartulli committed Jan 27, 2013
1 parent 3bc0306 commit 4a074d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 757dd82ea7008ddaccfecff3397bec3e3203a89e
refs/heads/master: b618ad1103c9ea0c4a69b44f42fc3c7b4e231e22
13 changes: 13 additions & 0 deletions trunk/net/batman-adv/distributed-arp-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
struct arphdr *arphdr;
struct ethhdr *ethhdr;
__be32 ip_src, ip_dst;
uint8_t *hw_src, *hw_dst;
uint16_t type = 0;

/* pull the ethernet header */
Expand Down Expand Up @@ -782,6 +783,18 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
ipv4_is_zeronet(ip_dst) || ipv4_is_lbcast(ip_dst))
goto out;

hw_src = batadv_arp_hw_src(skb, hdr_size);
if (is_zero_ether_addr(hw_src) || is_multicast_ether_addr(hw_src))
goto out;

/* we don't care about the destination MAC address in ARP requests */
if (arphdr->ar_op != htons(ARPOP_REQUEST)) {
hw_dst = batadv_arp_hw_dst(skb, hdr_size);
if (is_zero_ether_addr(hw_dst) ||
is_multicast_ether_addr(hw_dst))
goto out;
}

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

0 comments on commit 4a074d2

Please sign in to comment.