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] [day] [month] [year] [list]
Message-ID: <20110729095523.24f8d2dc@nehalam.ftrdhcpuser.net>
Date:	Fri, 29 Jul 2011 09:55:23 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Ben Hutchings <bhutchings@...arflare.com>
Cc:	Jiri Pirko <jpirko@...hat.com>, netdev@...r.kernel.org,
	davem@...emloft.net, eric.dumazet@...il.com
Subject: Re: [patch net-next-2.6] dummy: allow report link status and change
 it via sysfs

On Fri, 29 Jul 2011 18:03:09 +0200
Ben Hutchings <bhutchings@...arflare.com> wrote:

> On Fri, 2011-07-29 at 17:27 +0200, Jiri Pirko wrote:
> > Signed-off-by: Jiri Pirko <jpirko@...hat.com>
> > ---
> >  drivers/net/dummy.c |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 54 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
> > index 39cf9b9..fc39c24 100644
> > --- a/drivers/net/dummy.c
> > +++ b/drivers/net/dummy.c
> > @@ -37,9 +37,57 @@
> >  #include <linux/rtnetlink.h>
> >  #include <net/rtnetlink.h>
> >  #include <linux/u64_stats_sync.h>
> > +#include <linux/ethtool.h>
> >  
> >  static int numdummies = 1;
> >  
> > +static ssize_t dummy_show_link(struct device *d,
> > +			       struct device_attribute *attr,
> > +			       char *buf)
> > +{
> > +	struct net_device *dev = to_net_dev(d);
> > +
> > +	return sprintf(buf, "%d\n", netif_carrier_ok(dev) ? 1 : 0);
> > +}
> [...]
> 
> Net devices already have the 'carrier' attribute.  You should make that
> attribute writable for dummy devices, rather than adding another one.
> 

And adding ethtool support is unnecessary since carrier is already
reported by tools like 'ip link'
--
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