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.

tcp: Remove sk_protocol test for tcp_twsk_unique().

Commit 383eed2de529 ("tcp: get rid of twsk_unique()") added
sk->sk_protocol test in __inet_check_established() and
__inet6_check_established() to remove twsk_unique() and call
tcp_twsk_unique() directly.

DCCP has gone, and the condition is always true.

Let's remove the sk_protocol test.

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

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
9db0163e ee6960bd

+2 -4
+1 -2
net/ipv4/inet_hashtables.c
··· 579 579 if (likely(inet_match(net, sk2, acookie, ports, dif, sdif))) { 580 580 if (sk2->sk_state == TCP_TIME_WAIT) { 581 581 tw = inet_twsk(sk2); 582 - if (sk->sk_protocol == IPPROTO_TCP && 583 - tcp_twsk_unique(sk, sk2, twp)) 582 + if (tcp_twsk_unique(sk, sk2, twp)) 584 583 break; 585 584 } 586 585 goto not_unique;
+1 -2
net/ipv6/inet6_hashtables.c
··· 305 305 dif, sdif))) { 306 306 if (sk2->sk_state == TCP_TIME_WAIT) { 307 307 tw = inet_twsk(sk2); 308 - if (sk->sk_protocol == IPPROTO_TCP && 309 - tcp_twsk_unique(sk, sk2, twp)) 308 + if (tcp_twsk_unique(sk, sk2, twp)) 310 309 break; 311 310 } 312 311 goto not_unique;