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: <CANn89i+tQPGj+2cjHEFMbYGqKG=icVa580_gVUYw7Fb2W9sgtA@mail.gmail.com>
Date:   Wed, 28 Sep 2022 09:35:12 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     Juhee Kang <claudiajkang@...il.com>
Cc:     netdev <netdev@...r.kernel.org>,
        Simon Horman <simon.horman@...igine.com>,
        Jakub Kicinski <kuba@...nel.org>,
        David Miller <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH net-next v2] net: remove unused netdev_unregistering()

On Wed, Sep 28, 2022 at 9:17 AM Juhee Kang <claudiajkang@...il.com> wrote:
>
> A helper function which is netdev_unregistering on nedevice.h is
> no loger used. Thus, netdev_unregistering removes from netdevice.h.
>

I think we could explain a bit more why we think this function was not
really needed.

It was added in commit 8397ed36b7c5 ("net: ipv6: Release route when
device is unregistering")
then later, commit 27c6fa73f93b ("ipv6: Set nexthop flags upon carrier
change") removed the
only user of this helper. The only possible/valid case where we access
dev->reg_state
is in notifiers, and notifiers already have access to the 'event',
being NETDEV_UNREGISTER
or NETDEV_DOWN...


> Signed-off-by: Juhee Kang <claudiajkang@...il.com>
> ---
> v2:
>  - v1 link : https://lore.kernel.org/netdev/20220923160937.1912-1-claudiajkang@gmail.com/
>  - Remove netdev_unregistering().
>
>  include/linux/netdevice.h | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 9f42fc871c3b..66d10bcaa6f8 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -5100,11 +5100,6 @@ static inline const char *netdev_name(const struct net_device *dev)
>         return dev->name;
>  }
>
> -static inline bool netdev_unregistering(const struct net_device *dev)
> -{
> -       return dev->reg_state == NETREG_UNREGISTERING;
> -}
> -
>  static inline const char *netdev_reg_state(const struct net_device *dev)
>  {
>         switch (dev->reg_state) {
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ