Commit 9db0163e authored by Kuniyuki Iwashima's avatar Kuniyuki Iwashima Committed by Jakub Kicinski
Browse files

tcp: Remove sk_protocol test for tcp_twsk_unique().



Commit 383eed2d ("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: default avatarKuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250822190803.540788-2-kuniyu@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ee6960bd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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;