diff options
author | Eric Dumazet <edumazet@google.com> | 2024-10-10 17:48:16 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-10-14 17:39:37 -0700 |
commit | 507a96737d99686ca1714c7ba1f60ac323178189 (patch) | |
tree | 771d5ee371afa315e9cdd83eba46127f7b076140 /net/ipv6 | |
parent | 5ced52fa8f0dc23adb067f7b8a009a5ee051efb7 (diff) | |
download | lwn-507a96737d99686ca1714c7ba1f60ac323178189.tar.gz lwn-507a96737d99686ca1714c7ba1f60ac323178189.zip |
ipv6: tcp: give socket pointer to control skbs
tcp_v6_send_response() send orphaned 'control packets'.
These are RST packets and also ACK packets sent from TIME_WAIT.
Some eBPF programs would prefer to have a meaningful skb->sk
pointer as much as possible.
This means that TCP can now attach TIME_WAIT sockets to outgoing
skbs.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Brian Vazquez <brianvv@google.com>
Link: https://patch.msgid.link/20241010174817.1543642-5-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 7634c0be6acb..597920061a3a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -967,6 +967,9 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 } if (sk) { + /* unconstify the socket only to attach it to buff with care. */ + skb_set_owner_edemux(buff, (struct sock *)sk); + if (sk->sk_state == TCP_TIME_WAIT) mark = inet_twsk(sk)->tw_mark; else |