File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 7171 FN(DUP_FRAG) \
7272 FN(FRAG_REASM_TIMEOUT) \
7373 FN(FRAG_TOO_FAR) \
74+ FN(TCP_MINTTL) \
7475 FNe(MAX)
7576
7677/**
@@ -312,6 +313,11 @@ enum skb_drop_reason {
312313 * (/proc/sys/net/ipv4/ipfrag_max_dist)
313314 */
314315 SKB_DROP_REASON_FRAG_TOO_FAR ,
316+ /**
317+ * @SKB_DROP_REASON_TCP_MINTTL: ipv4 ttl or ipv6 hoplimit below
318+ * the threshold (IP_MINTTL or IPV6_MINHOPCOUNT).
319+ */
320+ SKB_DROP_REASON_TCP_MINTTL ,
315321 /**
316322 * @SKB_DROP_REASON_MAX: the maximum of drop reason, which shouldn't be
317323 * used as a real 'reason'
Original file line number Diff line number Diff line change @@ -2102,6 +2102,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
21022102 /* min_ttl can be changed concurrently from do_ip_setsockopt() */
21032103 if (unlikely (iph -> ttl < READ_ONCE (inet_sk (sk )-> min_ttl ))) {
21042104 __NET_INC_STATS (net , LINUX_MIB_TCPMINTTLDROP );
2105+ drop_reason = SKB_DROP_REASON_TCP_MINTTL ;
21052106 goto discard_and_relse ;
21062107 }
21072108 }
Original file line number Diff line number Diff line change @@ -1708,8 +1708,9 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb)
17081708
17091709 if (static_branch_unlikely (& ip6_min_hopcount )) {
17101710 /* min_hopcount can be changed concurrently from do_ipv6_setsockopt() */
1711- if (hdr -> hop_limit < READ_ONCE (tcp_inet6_sk (sk )-> min_hopcount )) {
1711+ if (unlikely ( hdr -> hop_limit < READ_ONCE (tcp_inet6_sk (sk )-> min_hopcount ) )) {
17121712 __NET_INC_STATS (net , LINUX_MIB_TCPMINTTLDROP );
1713+ drop_reason = SKB_DROP_REASON_TCP_MINTTL ;
17131714 goto discard_and_relse ;
17141715 }
17151716 }
You can’t perform that action at this time.
0 commit comments