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-next>] [day] [month] [year] [list]
Message-ID: <51CA1A1B.5080700@xdin.com>
Date:	Wed, 26 Jun 2013 00:30:51 +0200
From:	Arvid Brodin <arvid.brodin@...n.com>
To:	Stephen Hemminger <stephen@...workplumber.org>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Joe Perches <joe@...ches.com>,
	Javier Boticario <jboticario@...il.com>,
	"balferreira@...glemail.com" <balferreira@...glemail.com>
Subject: Re: [PATCH] net/hsr: Add support for the High-availability Seamless
 Redundancy protocol (HSRv0)

On 2013-06-25 02:07, Stephen Hemminger wrote:
> On Mon, 24 Jun 2013 09:44:01 -0700
> Arvid Brodin <arvid.brodin@...n.com> wrote:
> 
>> +
>> +
>> +static bool is_admin_up(struct net_device *dev)
>> +{
>> +       return dev && (dev->flags & IFF_UP);
>> +}
>> +
>> +static bool is_operstate_up(struct net_device *dev)
>> +{
>> +       return (dev && (dev->operstate == IF_OPER_UP));
>> +}
>> +
> 
> Isn't is_admin_up the same as netif_running()?

I don't think so (but I'm unsure). This is netif_running() (from include/linux/netdevice.h):

static inline bool netif_running(const struct net_device *dev)
{
	return test_bit(__LINK_STATE_START, &dev->state);
}

I'm not sure what this does. I don't think it's the same as checking whether the admin has
issued an UP command?


> And is_operstate_up the same as netif_oper_up()?

netif_oper_up() also returns true if the device state is IF_OPER_UNKNOWN. A device can
have that state without even having carrier, so that's not OK for the HSR driver.



-- 
Arvid Brodin | Consultant (Linux)
T: +46-8-56254286 | M: +46-70-9714286 | arvid.brodin@...n.com
XDIN AB | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden | xdin.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ