Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: neigh: use kfree_skb_reason() in neigh_resolve_output() and neigh_connected_output()

Replace kfree_skb() used in neigh_resolve_output() and
neigh_connected_output() with kfree_skb_reason().

Following new skb drop reason is added:
/* failed to fill the device hard header */
SKB_DROP_REASON_NEIGH_HH_FILLFAIL

Signed-off-by: Qiu Yutan <qiu.yutan@zte.com.cn>
Signed-off-by: Jiang Kun <jiang.kun2@zte.com.cn>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Xu Xin <xu.xin16@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Qiu Yutan and committed by
David S. Miller
e45b7196 8ceeef23

+5 -2
+3
include/net/dropreason-core.h
··· 62 62 FN(NEIGH_FAILED) \ 63 63 FN(NEIGH_QUEUEFULL) \ 64 64 FN(NEIGH_DEAD) \ 65 + FN(NEIGH_HH_FILLFAIL) \ 65 66 FN(TC_EGRESS) \ 66 67 FN(SECURITY_HOOK) \ 67 68 FN(QDISC_DROP) \ ··· 349 348 SKB_DROP_REASON_NEIGH_QUEUEFULL, 350 349 /** @SKB_DROP_REASON_NEIGH_DEAD: neigh entry is dead */ 351 350 SKB_DROP_REASON_NEIGH_DEAD, 351 + /** @SKB_DROP_REASON_NEIGH_HH_FILLFAIL: failed to fill the device hard header */ 352 + SKB_DROP_REASON_NEIGH_HH_FILLFAIL, 352 353 /** @SKB_DROP_REASON_TC_EGRESS: dropped in TC egress HOOK */ 353 354 SKB_DROP_REASON_TC_EGRESS, 354 355 /** @SKB_DROP_REASON_SECURITY_HOOK: dropped due to security HOOK */
+2 -2
net/core/neighbour.c
··· 1517 1517 return rc; 1518 1518 out_kfree_skb: 1519 1519 rc = -EINVAL; 1520 - kfree_skb(skb); 1520 + kfree_skb_reason(skb, SKB_DROP_REASON_NEIGH_HH_FILLFAIL); 1521 1521 goto out; 1522 1522 } 1523 1523 EXPORT_SYMBOL(neigh_resolve_output); ··· 1541 1541 err = dev_queue_xmit(skb); 1542 1542 else { 1543 1543 err = -EINVAL; 1544 - kfree_skb(skb); 1544 + kfree_skb_reason(skb, SKB_DROP_REASON_NEIGH_HH_FILLFAIL); 1545 1545 } 1546 1546 return err; 1547 1547 }