[systemd-devel] [systemd-commits] 2 commits - man/systemd-networkd.service.xml man/udev.xml src/network src/udev TODO
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Wed Feb 19 05:32:16 PST 2014
On Wed, Feb 19, 2014 at 11:35:09AM +0100, Tom Gundersen wrote:
> On Wed, Feb 19, 2014 at 2:41 AM, Zbigniew Jędrzejewski-Szmek
> <zbyszek at in.waw.pl> wrote:
> > On Tue, Feb 18, 2014 at 01:34:24PM -0800, Tom Gundersen wrote:
> >> diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
> >> index 48131c1..a470c22 100644
> >> --- a/src/network/networkd-network.c
> >> +++ b/src/network/networkd-network.c
> >> @@ -178,7 +178,7 @@ int network_get(Manager *manager, struct udev_device *device, Network **ret) {
> >> network->match_name,
> >> udev_device_get_sysattr_value(device, "address"),
> >> udev_device_get_property_value(device, "ID_PATH"),
> >> - udev_device_get_driver(device),
> >> + udev_device_get_driver(udev_device_get_parent(device)),
> >> udev_device_get_devtype(device),
> >> udev_device_get_sysname(device))) {
> >> log_debug("%s: found matching network '%s'",
> >> diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
> > I think this requires some oom hadling, since udev_device_get_parent allocates memory.
> > Even though udev_device_get_driver accepts NULL, wouldn't the result be correct?
>
> Hm. How would we distinguish between "no parent" and "oom"? Either way
> it will just return NULL. What do you have in mind?
You're right, there's no way to distinguish those cases with the current API.
Zbyszek
More information about the systemd-devel
mailing list