]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit()
authorEric Dumazet <edumazet@google.com>
Mon, 11 May 2026 07:23:10 +0000 (07:23 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 May 2026 01:31:12 +0000 (18:31 -0700)
Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call,
and provide IP_OUTNOROUTES drop reason.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260511072310.1094859-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/inet6_connection_sock.c

index 37534e1168992c44e1400dacab87e79d04c64a41..4665d84a7380d90b7d180a429017f577fcb6936a 100644 (file)
@@ -102,7 +102,8 @@ int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused
                if (IS_ERR(dst)) {
                        WRITE_ONCE(sk->sk_err_soft, -PTR_ERR(dst));
                        sk->sk_route_caps = 0;
-                       kfree_skb(skb);
+                       sk_skb_reason_drop(sk, skb,
+                                          SKB_DROP_REASON_IP_OUTNOROUTES);
                        return PTR_ERR(dst);
                }
                /* Restore final destination back after routing done */