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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1306434959.3151.39.camel@dcbw.foobar.com>
Date:	Thu, 26 May 2011 13:35:58 -0500
From:	Dan Williams <dcbw@...hat.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, Chas Williams <chas@....nrl.navy.mil>,
	David Woodhouse <dwmw2@...radead.org>, stable@...nel.org
Subject: Re: [PATCH] atm: expose ATM device index in sysfs

On Thu, 2011-05-26 at 19:55 +0200, Eric Dumazet wrote:
> Le jeudi 26 mai 2011 à 12:47 -0500, Dan Williams a écrit :
> > It's current exposed only through /proc which besides requiring
> > screen-scraping doesn't allow userspace to distinguish between two
> > identical ATM adapters with different ATM indexes.  The ATM device index
> > is required when using PPPoATM on a system with multiple ATM adapters.
> > 
> > Signed-off-by: Dan Williams <dcbw@...hat.com>
> > ---
> > 
> > PS: -> stable too since it's a minimal change with no backwards
> > incompatibility and I'd like to rely on this attribute in NetworkManager
> > 
> > diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
> > index f7fa67c..e5edbde 100644
> > --- a/net/atm/atm_sysfs.c
> > +++ b/net/atm/atm_sysfs.c
> > @@ -59,6 +59,16 @@ static ssize_t show_atmaddress(struct device *cdev,
> >  	return pos - buf;
> >  }
> >  
> > +static ssize_t show_atmindex(struct device *cdev,
> > +			     struct device_attribute *attr, char *buf)
> > +{
> > +	char *pos = buf;
> > +	struct atm_dev *adev = to_atm_dev(cdev);
> > +
> > +	pos += sprintf(pos, "%d\n", adev->number);
> > +	return pos - buf;
> > +}
> > +
> 
> What about :
> 
> {
> 	struct atm_dev *adev = to_atm_dev(cdev);
> 
> 	return sprintf(buf, "%d\n", adev->number);
> }

Sure, will send v2.

Dan

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