]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tcp: Remove sk_protocol test for tcp_twsk_unique().
authorKuniyuki Iwashima <kuniyu@google.com>
Fri, 22 Aug 2025 19:06:56 +0000 (19:06 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 26 Aug 2025 00:53:35 +0000 (17:53 -0700)
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>
net/ipv4/inet_hashtables.c
net/ipv6/inet6_hashtables.c

index ceeeec9b7290aabdab8c400cd202312b0f0be70b..fef71dd725217a4c936950dcb69c3100cc6ef4f0 100644 (file)
@@ -579,8 +579,7 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row,
                if (likely(inet_match(net, sk2, acookie, ports, dif, sdif))) {
                        if (sk2->sk_state == TCP_TIME_WAIT) {
                                tw = inet_twsk(sk2);
-                               if (sk->sk_protocol == IPPROTO_TCP &&
-                                   tcp_twsk_unique(sk, sk2, twp))
+                               if (tcp_twsk_unique(sk, sk2, twp))
                                        break;
                        }
                        goto not_unique;
index 76ee521189eb77c48845eeeac9d50b3a93a250a6..dbb10774764ac8187727c41fb3e92420ff544833 100644 (file)
@@ -305,8 +305,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
                                       dif, sdif))) {
                        if (sk2->sk_state == TCP_TIME_WAIT) {
                                tw = inet_twsk(sk2);
-                               if (sk->sk_protocol == IPPROTO_TCP &&
-                                   tcp_twsk_unique(sk, sk2, twp))
+                               if (tcp_twsk_unique(sk, sk2, twp))
                                        break;
                        }
                        goto not_unique;