Skip to content

Commit 5767596

Browse files
edumazetgregkh
authored andcommitted
net: dropreason: add SKB_DROP_REASON_RECURSION_LIMIT
[ Upstream commit d15d3de ] ip[6]tunnel_xmit() can drop packets if a too deep recursion level is detected. Add SKB_DROP_REASON_RECURSION_LIMIT drop reason. We will use this reason later in __dev_queue_xmit(). Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260312201824.203093-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 7fb4c19 ("net: pull headers in qdisc_pkt_len_segs_init()") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cc86a8b commit 5767596

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

include/net/dropreason-core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
FN(DUALPI2_STEP_DROP) \
131131
FN(PSP_INPUT) \
132132
FN(PSP_OUTPUT) \
133+
FN(RECURSION_LIMIT) \
133134
FNe(MAX)
134135

135136
/**
@@ -622,6 +623,8 @@ enum skb_drop_reason {
622623
SKB_DROP_REASON_PSP_INPUT,
623624
/** @SKB_DROP_REASON_PSP_OUTPUT: PSP output checks failed */
624625
SKB_DROP_REASON_PSP_OUTPUT,
626+
/** @SKB_DROP_REASON_RECURSION_LIMIT: Dead loop on virtual device. */
627+
SKB_DROP_REASON_RECURSION_LIMIT,
625628
/**
626629
* @SKB_DROP_REASON_MAX: the maximum of core drop reasons, which
627630
* shouldn't be used as a real 'reason' - only for tracing code gen

include/net/ip6_tunnel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
162162
dev->name);
163163
DEV_STATS_INC(dev, tx_errors);
164164
}
165-
kfree_skb(skb);
165+
kfree_skb_reason(skb, SKB_DROP_REASON_RECURSION_LIMIT);
166166
return;
167167
}
168168

net/ipv4/ip_tunnel_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
6565
DEV_STATS_INC(dev, tx_errors);
6666
}
6767
ip_rt_put(rt);
68-
kfree_skb(skb);
68+
kfree_skb_reason(skb, SKB_DROP_REASON_RECURSION_LIMIT);
6969
return;
7070
}
7171

0 commit comments

Comments
 (0)