From 9b1c2626cef16722603bded9bb52033aba34dd74 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 18 Feb 2014 22:06:49 +0100 Subject: [PATCH] net-match: fix Driver= match It should match on the driver of the parent device. --- TODO | 1 - man/systemd-networkd.service.xml | 3 ++- man/udev.xml | 3 ++- src/network/networkd-network.c | 2 +- src/udev/net/link-config.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index 925d7a55746..57c057227b5 100644 --- a/TODO +++ b/TODO @@ -639,7 +639,6 @@ Features: - Make sure ID_PATH is always exported and complete for network devices where possible, so we can safely rely on Path= matching - - Check if Driver= is broken, or just my driver (bcma) * sd-rtnl: - add support for exiting containers without reading them fully first diff --git a/man/systemd-networkd.service.xml b/man/systemd-networkd.service.xml index 9c7ca83438d..04fedc56d05 100644 --- a/man/systemd-networkd.service.xml +++ b/man/systemd-networkd.service.xml @@ -165,7 +165,8 @@ Driver The driver currently bound to the device, as - exposed by the udev property DRIVER. + exposed by the udev property DRIVER + of its parent device. diff --git a/man/udev.xml b/man/udev.xml index 54a2dd33dd8..eab5d25f0a5 100644 --- a/man/udev.xml +++ b/man/udev.xml @@ -805,7 +805,8 @@ Driver - The driver currently bound to the device, as exposed by the udev property DRIVER. + The driver currently bound to the device, as exposed by the + udev property DRIVER of its parent device. diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 48131c1f090..a470c22e3df 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 index bd97cd8cf87..3afaff10c8c 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",