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?
> index bd97cd8..3afaff1 100644
> --- a/src/udev/net/link-config.c
> +++ b/src/udev/net/link-config.c
> @@ -244,7 +244,7 @@ int link_config_get(link_config_ctx *ctx, struct
> udev_device *device, link_confi
> link->match_driver, link->match_type,
> NULL,
> 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),
> NULL)) {
> log_debug("Config file %s applies to device %s",
Zbyszek
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel