Also fix a copy-paste error that broke matching on interface name.
<listitem>
<para>The driver currently bound to the device, as
exposed by the udev property <literal>DRIVER</literal>
- of its parent device.
- </para>
+ of its parent device, or if that is not set the driver
+ as exposed by <literal>ethtool -i</literal> of the
+ device itself.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>Driver=</varname></term>
<listitem>
<para>The driver currently bound to the device, as exposed by the
- udev property <literal>DRIVER</literal> of its parent device.</para>
+ udev property <literal>DRIVER</literal> of its parent device, or if
+ that is not set the driver as exposed by <literal>ethtool -i</literal>
+ of the device itself.</para>
</listitem>
</varlistentry>
<varlistentry>
if (net_match_config(NULL, NULL, NULL, NULL, NULL,
netdev->match_host, netdev->match_virt,
netdev->match_kernel, netdev->match_arch,
- NULL, NULL, NULL, NULL, NULL) <= 0)
+ NULL, NULL, NULL, NULL, NULL, NULL) <= 0)
return 0;
r = hashmap_put(netdev->manager->netdevs, netdev->name, netdev);
udev_device_get_sysattr_value(device, "address"),
udev_device_get_property_value(device, "ID_PATH"),
udev_device_get_driver(udev_device_get_parent(device)),
+ udev_device_get_property_value(device, "ID_NET_DRIVER"),
udev_device_get_devtype(device),
udev_device_get_sysname(device))) {
log_debug("%s: found matching network '%s'",
Condition *match_arch,
const char *dev_mac,
const char *dev_path,
+ const char *dev_parent_driver,
const char *dev_driver,
const char *dev_type,
const char *dev_name) {
if (match_path && (!dev_path || fnmatch(match_path, dev_path, 0)))
return 0;
- if (match_driver && !streq_ptr(match_driver, dev_driver))
- return 0;
+ if (match_driver) {
+ if (dev_parent_driver && !streq(match_driver, dev_parent_driver))
+ return 0;
+ else if (!streq_ptr(match_driver, dev_driver))
+ return 0;
+ }
if (match_type && !streq_ptr(match_type, dev_type))
return 0;
- if (match_name && (!dev_path || fnmatch(match_name, dev_name, 0)))
+ if (match_name && (!dev_name || fnmatch(match_name, dev_name, 0)))
return 0;
return 1;
Condition *match_arch,
const char *dev_mac,
const char *dev_path,
+ const char *dev_parent_driver,
const char *dev_driver,
const char *dev_type,
const char *dev_name);
udev_device_get_sysattr_value(device, "address"),
udev_device_get_property_value(device, "ID_PATH"),
udev_device_get_driver(udev_device_get_parent(device)),
+ udev_device_get_property_value(device, "ID_NET_DRIVER"),
udev_device_get_devtype(device),
NULL)) {
log_debug("Config file %s applies to device %s",