lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLjgDG5EB2nPWsS7GVmf360-Q_7OSZ3qRZb_SToOar8wQ@mail.gmail.com>
Date: Thu, 26 Jun 2025 07:26:24 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuni1840@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Kuniyuki Iwashima <kuniyu@...gle.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 01/15] ipv6: ndisc: Remove __in6_dev_get() in pndisc_{constructor,destructor}().

On Tue, Jun 24, 2025 at 1:26 PM Kuniyuki Iwashima <kuni1840@...il.com> wrote:
>
> From: Kuniyuki Iwashima <kuniyu@...gle.com>
>
> ipv6_dev_mc_{inc,dec}() has the same check.
>
> Let's remove __in6_dev_get() from pndisc_constructor() and
> pndisc_destructor().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
> ---
>  net/ipv6/ndisc.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index ecb5c4b8518f..beb1814a1ac2 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -377,11 +377,12 @@ static int ndisc_constructor(struct neighbour *neigh)
>  static int pndisc_constructor(struct pneigh_entry *n)
>  {
>         struct in6_addr *addr = (struct in6_addr *)&n->key;
> -       struct in6_addr maddr;
>         struct net_device *dev = n->dev;
> +       struct in6_addr maddr;
>
> -       if (!dev || !__in6_dev_get(dev))
> +       if (!dev)
>                 return -EINVAL;
> +
>         addrconf_addr_solict_mult(addr, &maddr);
>         ipv6_dev_mc_inc(dev, &maddr);

return ipv6_dev_mc_inc(dev, &maddr); ?

>         return 0;
> @@ -390,11 +391,12 @@ static int pndisc_constructor(struct pneigh_entry *n)
>  static void pndisc_destructor(struct pneigh_entry *n)
>  {
>         struct in6_addr *addr = (struct in6_addr *)&n->key;
> -       struct in6_addr maddr;
>         struct net_device *dev = n->dev;
> +       struct in6_addr maddr;
>
> -       if (!dev || !__in6_dev_get(dev))
> +       if (!dev)
>                 return;
> +
>         addrconf_addr_solict_mult(addr, &maddr);
>         ipv6_dev_mc_dec(dev, &maddr);

return ipv6_dev_mc_dec(dev, &maddr);

>  }
> --

If not needed (because of a future patch ?), this should be mentioned
in the changelog.

> 2.49.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ