Skip to content

Commit

Permalink
net: dropreason: add SKB_DROP_REASON_FRAG_TOO_FAR
Browse files Browse the repository at this point in the history
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 <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Nov 1, 2022
1 parent 77adfd3 commit 3bdfb04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions include/net/dropreason.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
FN(PKT_TOO_BIG) \
FN(DUP_FRAG) \
FN(FRAG_REASM_TIMEOUT) \
FN(FRAG_TOO_FAR) \
FNe(MAX)

/**
Expand Down Expand Up @@ -306,6 +307,11 @@ enum skb_drop_reason {
SKB_DROP_REASON_DUP_FRAG,
/** @SKB_DROP_REASON_FRAG_REASM_TIMEOUT: fragment reassembly timeout */
SKB_DROP_REASON_FRAG_REASM_TIMEOUT,
/**
* @SKB_DROP_REASON_FRAG_TOO_FAR: ipv4 fragment too far.
* (/proc/sys/net/ipv4/ipfrag_max_dist)
*/
SKB_DROP_REASON_FRAG_TOO_FAR,
/**
* @SKB_DROP_REASON_MAX: the maximum of drop reason, which shouldn't be
* used as a real 'reason'
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ip_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static int ip_frag_reinit(struct ipq *qp)
}

sum_truesize = inet_frag_rbtree_purge(&qp->q.rb_fragments,
SKB_DROP_REASON_NOT_SPECIFIED);
SKB_DROP_REASON_FRAG_TOO_FAR);
sub_frag_mem_limit(qp->q.fqdir, sum_truesize);

qp->q.flags = 0;
Expand Down

0 comments on commit 3bdfb04

Please sign in to comment.