Subject: Re: [PATCH RESEND net-next v4 1/3] net: Add a bhash2 table hashed by port and address

From: Andrei Vagin <[email-masked]>
Date: Mon, 11 Sep 2023 16:36:55 -0700

On Mon, Aug 22, 2022 at 11:10:21AM -0700, Joanne Koong wrote:
>  
> +static bool inet_use_bhash2_on_bind(const struct sock *sk)
> +{
> +#if IS_ENABLED(CONFIG_IPV6)
> +	if (sk->sk_family == AF_INET6) {
> +		int addr_type = ipv6_addr_type(&sk->sk_v6_rcv_saddr);
> +
> +		return addr_type != IPV6_ADDR_ANY &&
> +			addr_type != IPV6_ADDR_MAPPED;
>

Why do we return false to all mapped addresses? Should it be

(addr_type != IPV6_ADDR_MAPPED || sk->sk_rcv_saddr != htonl(INADDR_ANY))

>
> +	}
> +#endif
> +	return sk->sk_rcv_saddr != htonl(INADDR_ANY);
> +}
> +
>
Thanks,
Andrei