Skip to content

Commit 3bdfb04

Browse files
edumazetkuba-moo
authored andcommitted
net: dropreason: add SKB_DROP_REASON_FRAG_TOO_FAR
IPv4 reassembly unit can decide to drop frags based on /proc/sys/net/ipv4/ipfrag_max_dist sysctl. Add a specific drop reason to track this specific and weird case. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 77adfd3 commit 3bdfb04

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/net/dropreason.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
FN(PKT_TOO_BIG) \
7171
FN(DUP_FRAG) \
7272
FN(FRAG_REASM_TIMEOUT) \
73+
FN(FRAG_TOO_FAR) \
7374
FNe(MAX)
7475

7576
/**
@@ -306,6 +307,11 @@ enum skb_drop_reason {
306307
SKB_DROP_REASON_DUP_FRAG,
307308
/** @SKB_DROP_REASON_FRAG_REASM_TIMEOUT: fragment reassembly timeout */
308309
SKB_DROP_REASON_FRAG_REASM_TIMEOUT,
310+
/**
311+
* @SKB_DROP_REASON_FRAG_TOO_FAR: ipv4 fragment too far.
312+
* (/proc/sys/net/ipv4/ipfrag_max_dist)
313+
*/
314+
SKB_DROP_REASON_FRAG_TOO_FAR,
309315
/**
310316
* @SKB_DROP_REASON_MAX: the maximum of drop reason, which shouldn't be
311317
* used as a real 'reason'

net/ipv4/ip_fragment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static int ip_frag_reinit(struct ipq *qp)
256256
}
257257

258258
sum_truesize = inet_frag_rbtree_purge(&qp->q.rb_fragments,
259-
SKB_DROP_REASON_NOT_SPECIFIED);
259+
SKB_DROP_REASON_FRAG_TOO_FAR);
260260
sub_frag_mem_limit(qp->q.fqdir, sum_truesize);
261261

262262
qp->q.flags = 0;

0 commit comments

Comments
 (0)