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
453 SKB_DROP_REASON_IP_INNOROUTES, /* network unreachable, corresponding453 SKB_DROP_REASON_IP_INNOROUTES, /* network unreachable, corresponding
454 * to IPSTATS_MIB_INADDRERRORS454 * to IPSTATS_MIB_INADDRERRORS
455 */455 */
456 SKB_DROP_REASON_PKT_TOO_BIG, /* packet size is too big (maybe exceed
457 * the MTU)
458 */
456 SKB_DROP_REASON_MAX,459 SKB_DROP_REASON_MAX,
457};460};
458 461
include/trace/events/skb.h+1−0
@@ -65,6 +65,7 @@ · 64 unmodified lines
65 EM(SKB_DROP_REASON_INVALID_PROTO, INVALID_PROTO) \65 EM(SKB_DROP_REASON_INVALID_PROTO, INVALID_PROTO) \
66 EM(SKB_DROP_REASON_IP_INADDRERRORS, IP_INADDRERRORS) \66 EM(SKB_DROP_REASON_IP_INADDRERRORS, IP_INADDRERRORS) \
67 EM(SKB_DROP_REASON_IP_INNOROUTES, IP_INNOROUTES) \67 EM(SKB_DROP_REASON_IP_INNOROUTES, IP_INNOROUTES) \
68 EM(SKB_DROP_REASON_PKT_TOO_BIG, PKT_TOO_BIG) \
68 EMe(SKB_DROP_REASON_MAX, MAX)69 EMe(SKB_DROP_REASON_MAX, MAX)
69 70
70#undef EM71#undef EM