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: <20140701122637.GB1204@oc0268524204.ibm.com>
Date:	Tue, 1 Jul 2014 09:26:38 -0300
From:	Thadeu Lima de Souza Cascardo <cascardo@...ux.vnet.ibm.com>
To:	Bjørn Mork <bjorn@...k.no>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] Use dev_port for the ID of a network device.

On Tue, Jul 01, 2014 at 08:45:56AM +0200, Bjørn Mork wrote:
> Thadeu Lima de Souza Cascardo <cascardo@...ux.vnet.ibm.com> writes:
> 
> > diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
> > index c80c30a..6de9c98 100644
> > --- a/src/udev/udev-builtin-net_id.c
> > +++ b/src/udev/udev-builtin-net_id.c
> > @@ -186,9 +186,14 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
> >                  return -ENOENT;
> >  
> >          /* kernel provided multi-device index */
> > -        attr = udev_device_get_sysattr_value(dev, "dev_id");
> > -        if (attr)
> > +        attr = udev_device_get_sysattr_value(dev, "dev_port");
> > +        if (attr) {
> >                  dev_id = strtol(attr, NULL, 16);
> > +        } else {
> > +                attr = udev_device_get_sysattr_value(dev, "dev_id");
> > +                if (attr)
> > +                        dev_id = strtol(attr, NULL, 16);
> > +        }
> >  
> >          /* compose a name based on the raw kernel's PCI bus, slot numbers */
> >          s = names->pci_path;
> 
> Note that the base of the new attribute is 10, not 16:
> 
> bjorn@...i:/usr/local/src/git/linux$ git grep dev_port net/core/
> net/core/net-sysfs.c:NETDEVICE_SHOW_RO(dev_port, fmt_dec);
> net/core/net-sysfs.c:   &dev_attr_dev_port.attr,
> bjorn@...i:/usr/local/src/git/linux$ git grep dev_id net/core/
> net/core/net-sysfs.c:NETDEVICE_SHOW_RO(dev_id, fmt_hex);
> net/core/net-sysfs.c:   &dev_attr_dev_id.attr,
> 
> 
> 
> Bjørn
> 

Thanks for noticing, I'll fix that.

Cascardo.

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