Skip to contentSkip to conversation

arp: Do not perturb drop profiles with ignored ARP packets

RFC PATCH In review Rick Jones 2 participants 2 messages Sep 25, 2014 – Sep 28, 2014

Subsystems (3)
lore
Share & tools
lore

Rick Jones

author
#0 lore raw

RFC PATCH 1/1 arp: Do not perturb drop profiles with ignored ARP packets

From: Rick Jones <[email protected]>

We do not wish to disturb dropwatch or perf drop profiles with an ARP we will ignore.

---

Compile tested only after seeing arp_rcv in a perf top -G -e skb:kfree_skb

net/ipv4/arp.c +5 -1
index 1a9b99e..16acb59 100644
@@ -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)
@@ -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: