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: <1405616424.12363.47.camel@joe-AO725>
Date:	Thu, 17 Jul 2014 10:00:24 -0700
From:	Joe Perches <joe@...ches.com>
To:	Veaceslav Falico <vfalico@...il.com>
Cc:	netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
	Jason Baron <jbaron@...mai.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Vlad Yasevich <vyasevic@...hat.com>,
	stephen hemminger <stephen@...workplumber.org>,
	Jerry Chu <hkchu@...gle.com>,
	Ben Hutchings <bhutchings@...arflare.com>
Subject: Re: [PATCH v2 net-next 2/2] net: print net_device reg_state in
 netdev_* unless it's registered

On Thu, 2014-07-17 at 16:09 +0200, Veaceslav Falico wrote:
> This way we'll always know in what status the device is, unless it's
> running normally (i.e. NETDEV_REGISTERED).
[]
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
[]
> @@ -3388,6 +3388,20 @@ static inline const char *netdev_name(const struct net_device *dev)
>  	return dev->name;
>  }
>  
> +static inline const char *netdev_reg_state(const struct net_device *dev)
> +{
> +	switch (dev->reg_state) {
> +	case NETREG_UNINITIALIZED: return " (unregistered)";

Why not " (uninitialized)"?

> +	case NETREG_REGISTERED: return "";
> +	case NETREG_UNREGISTERING: return " (unregistering)";
> +	case NETREG_UNREGISTERED: return " (unregistered)";
> +	case NETREG_RELEASED: return " (released)";
> +	case NETREG_DUMMY: return " (dummy)";
> +	}
> +
> +	return " (unknown)";

Shouldn't this " (unknown)" have stronger text
and use a WARN_ON_ONCE?

I'd put this in net/core/dev.c and make it not be static inline.


--
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