[systemd-devel] [PATCH] udev: make net_id more robust

Kay Sievers kay at vrfy.org
Fri Jun 7 11:25:40 PDT 2013


On Fri, Jun 7, 2013 at 3:27 PM, Sean McGovern <gseanmcg at gmail.com> wrote:
> Onboard network controllers are not always on PCI domain 0.

> +        sysname = udev_device_get_sysname(names->pcidev);
> +
> +        if(!sysname)
> +            return -ENOENT;
> +
> +        if(!strlen(sysname))
> +            return -ENOENT;

None of these checks should be needed.

> +        if(sscanf(sysname, "%lx:%x:%x.%d", &domain, &bus, &slot, &func) != 4)
> +            return -ENOENT;

We only support domain 0, and ignore all other devices so far.

With the above change we would just ignore the domain and allow
possibly conflicting identical names below different domains?

I don't understand what you intend here, please be more specific than
"more robust" in patch descriptions.

Thanks,
Kay


More information about the systemd-devel mailing list