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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Vagin <avagin@xxxxxxxxx>
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))
> 

Yes, that could be done as optimisation.






[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux