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]
Date:   Fri, 2 Oct 2020 11:07:03 +0200
From:   Sabrina Dubroca <sd@...asysnail.net>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     netdev@...r.kernel.org,
        Nicolas Dichtel <nicolas.dichtel@...nd.com>,
        Marek Lindner <mareklindner@...mailbox.ch>,
        Simon Wunderlich <sw@...onwunderlich.de>,
        Antonio Quartulli <a@...table.cc>,
        Sven Eckelmann <sven@...fation.org>,
        b.a.t.m.a.n@...ts.open-mesh.org, Roopa Prabhu <roopa@...dia.com>,
        Nikolay Aleksandrov <nikolay@...dia.com>
Subject: Re: [PATCH net 00/12] net: iflink and link-netnsid fixes

2020-10-01, 14:25:38 -0700, Stephen Hemminger wrote:
> On Thu,  1 Oct 2020 09:59:24 +0200
> Sabrina Dubroca <sd@...asysnail.net> wrote:
> 
> > In a lot of places, we use this kind of comparison to detect if a
> > device has a lower link:
> > 
> >   dev->ifindex != dev_get_iflink(dev)
> 
> 
> Since this is a common operation, it would be good to add a new
> helper function in netdevice.h
> 
> In your patch set, you are copying the same code snippet which
> seems to indicate that it should be a helper.
> 
> Something like:
> 
> static inline bool netdev_has_link(const struct net_device *dev)
> {
> 	const struct net_device_ops *ops = dev->netdev_ops;
> 
> 	return ops && ops->ndo_get_iflink;
> }

Good idea, I'll add that in v2.

-- 
Sabrina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ