History

net: ip: add skb drop reasons to ip forwarding

Replace kfree_skb() which is used in ip6_forward() and ip_forward() with kfree_skb_reason(). The new drop reason 'SKB_DROP_REASON_PKT_TOO_BIG' is introduced for the case that the length of the packet exceeds MTU and can't fragment.

Menglong Dong committed 4 years ago

Commit 2edc1a31 parent 3ae42cc4 files · +20 −6Browse files

Showing the changes to include (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/skbuff.h +3 −0
  2. include/trace/events/skb.h +1 −0
include/linux/skbuff.h+3−0
@@ -453,6 +453,9 @@ enum skb_drop_reason { · 452 unmodified lines
453453 SKB_DROP_REASON_IP_INNOROUTES, /* network unreachable, corresponding
454454 * to IPSTATS_MIB_INADDRERRORS
455455 */
456+ SKB_DROP_REASON_PKT_TOO_BIG, /* packet size is too big (maybe exceed
457+ * the MTU)
458+ */
456459 SKB_DROP_REASON_MAX,
457460 };
458461
include/trace/events/skb.h+1−0
@@ -65,6 +65,7 @@ · 64 unmodified lines
6565 EM(SKB_DROP_REASON_INVALID_PROTO, INVALID_PROTO) \
6666 EM(SKB_DROP_REASON_IP_INADDRERRORS, IP_INADDRERRORS) \
6767 EM(SKB_DROP_REASON_IP_INNOROUTES, IP_INNOROUTES) \
68+ EM(SKB_DROP_REASON_PKT_TOO_BIG, PKT_TOO_BIG) \
6869 EMe(SKB_DROP_REASON_MAX, MAX)
6970
7071 #undef EM