Skip to content

Commit 507a967

Browse files
edumazetkuba-moo
authored andcommitted
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>
1 parent 5ced52f commit 507a967

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv6/tcp_ipv6.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,9 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
967967
}
968968

969969
if (sk) {
970+
/* unconstify the socket only to attach it to buff with care. */
971+
skb_set_owner_edemux(buff, (struct sock *)sk);
972+
970973
if (sk->sk_state == TCP_TIME_WAIT)
971974
mark = inet_twsk(sk)->tw_mark;
972975
else

0 commit comments

Comments
 (0)