Skip to content

Commit

Permalink
arp: Do not perturb drop profiles with ignored ARP packets
Browse files Browse the repository at this point in the history
We do not wish to disturb dropwatch or perf drop profiles with an ARP
we will ignore.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rick Jones authored and David S. Miller committed Sep 28, 2014
1 parent 18d0264 commit 825bae5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/ipv4/arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,10 +953,11 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
{
const struct arphdr *arp;

/* do not tweak dropwatch on an ARP we will ignore */
if (dev->flags & IFF_NOARP ||
skb->pkt_type == PACKET_OTHERHOST ||
skb->pkt_type == PACKET_LOOPBACK)
goto freeskb;
goto consumeskb;

skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb)
Expand All @@ -974,6 +975,9 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev,

return NF_HOOK(NFPROTO_ARP, NF_ARP_IN, skb, dev, NULL, arp_process);

consumeskb:
consume_skb(skb);
return 0;
freeskb:
kfree_skb(skb);
out_of_mem:
Expand Down

0 comments on commit 825bae5

Please sign in to comment.