tcp: Save address type in inet_bind2_bucket.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 19 Dec 2023 00:18:25 +0000 (09:18 +0900)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Dec 2023 22:15:34 +0000 (22:15 +0000)
commit5a22bba13d0162d278d6e31232259ddcce196b8e
tree862106a0d977770e96a49668bb4d7e6f65e7acac
parent06a8c04f89949576b715f11350f1896b62cecb0a
tcp: Save address type in inet_bind2_bucket.

inet_bind2_bucket_addr_match() and inet_bind2_bucket_match_addr_any()
are called for each bhash2 bucket to check conflicts.  Thus, we call
ipv6_addr_any() and ipv6_addr_v4mapped() over and over during bind().

Let's avoid calling them by saving the address type in inet_bind2_bucket.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_hashtables.h
net/ipv4/inet_hashtables.c