]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipv6: pass proto by value to ipv6_push_nfrag_opts() and ipv6_push_frag_opts()
authorEric Dumazet <edumazet@google.com>
Fri, 30 Jan 2026 21:02:56 +0000 (21:02 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Feb 2026 01:49:28 +0000 (17:49 -0800)
commit1bc46dd209667346c5aa56c351995e7c260696d0
tree888d8a48e65e6f0bf6ebb1223e115471e036abf7
parente0221553436b1c49a14ae251d95ea2e19c5b5a14
ipv6: pass proto by value to ipv6_push_nfrag_opts() and ipv6_push_frag_opts()

With CONFIG_STACKPROTECTOR_STRONG=y, it is better to avoid passing
a pointer to an automatic variable.

Change these exported functions to return 'u8 proto'
instead of void.

- ipv6_push_nfrag_opts()
- ipv6_push_frag_opts()

For instance, replace
ipv6_push_frag_opts(skb, opt, &proto);
with:
proto = ipv6_push_frag_opts(skb, opt, proto);

Note that even after this change, ip6_xmit() has to use a stack canary
because of @first_hop variable.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260130210303.3888261-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/ipv6.h
net/ipv6/exthdrs.c
net/ipv6/ip6_output.c
net/ipv6/ip6_tunnel.c