Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipv6: use inet->cork.fl.u.ip6 and np->final in ip6_datagram_dst_update()

Get rid of @fl6 and &final variables in ip6_datagram_dst_update().

Use instead inet->cork.fl.u.ip6 and np->final so that a stack canary
is no longer needed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260206173426.1638518-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
4e6c91cf 3d3f075e

+11 -10
+11 -10
net/ipv6/datagram.c
··· 72 72 int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr) 73 73 { 74 74 struct ip6_flowlabel *flowlabel = NULL; 75 - struct in6_addr *final_p, final; 76 - struct ipv6_txoptions *opt; 77 - struct dst_entry *dst; 78 75 struct inet_sock *inet = inet_sk(sk); 79 76 struct ipv6_pinfo *np = inet6_sk(sk); 80 - struct flowi6 fl6; 77 + struct ipv6_txoptions *opt; 78 + struct in6_addr *final_p; 79 + struct dst_entry *dst; 80 + struct flowi6 *fl6; 81 81 int err = 0; 82 82 83 83 if (inet6_test_bit(SNDFLOW, sk) && ··· 86 86 if (IS_ERR(flowlabel)) 87 87 return -EINVAL; 88 88 } 89 - ip6_datagram_flow_key_init(&fl6, sk); 89 + fl6 = &inet_sk(sk)->cork.fl.u.ip6; 90 + ip6_datagram_flow_key_init(fl6, sk); 90 91 91 92 rcu_read_lock(); 92 93 opt = flowlabel ? flowlabel->opt : rcu_dereference(np->opt); 93 - final_p = fl6_update_dst(&fl6, opt, &final); 94 + final_p = fl6_update_dst(fl6, opt, &np->final); 94 95 rcu_read_unlock(); 95 96 96 - dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p); 97 + dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_p); 97 98 if (IS_ERR(dst)) { 98 99 err = PTR_ERR(dst); 99 100 goto out; ··· 102 101 103 102 if (fix_sk_saddr) { 104 103 if (ipv6_addr_any(&np->saddr)) 105 - np->saddr = fl6.saddr; 104 + np->saddr = fl6->saddr; 106 105 107 106 if (ipv6_addr_any(&sk->sk_v6_rcv_saddr)) { 108 - sk->sk_v6_rcv_saddr = fl6.saddr; 107 + sk->sk_v6_rcv_saddr = fl6->saddr; 109 108 inet->inet_rcv_saddr = LOOPBACK4_IPV6; 110 109 if (sk->sk_prot->rehash) 111 110 sk->sk_prot->rehash(sk); 112 111 } 113 112 } 114 113 115 - ip6_sk_dst_store_flow(sk, dst, &fl6); 114 + ip6_sk_dst_store_flow(sk, dst, fl6); 116 115 117 116 out: 118 117 fl6_sock_release(flowlabel);