From: Tom Gundersen Date: Fri, 3 Jan 2014 19:55:23 +0000 (+0100) Subject: net-util: add support for Type=ethernet X-Git-Tag: v209~552 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=4cd1214db6cf4b262e8ce6381bc710091b375c96 net-util: add support for Type=ethernet When DEVTYPE is not set for a nic, it means it is a wired/ethernet device. --- diff --git a/man/systemd-networkd.service.xml b/man/systemd-networkd.service.xml index 908354c58..f38e813e4 100644 --- a/man/systemd-networkd.service.xml +++ b/man/systemd-networkd.service.xml @@ -146,7 +146,8 @@ Type The device type, as exposed by the udev property - DEVTYPE. + DEVTYPE, or ethernet + to match devices without a DEVTYPE. diff --git a/man/udev.xml b/man/udev.xml index 32a520e7b..0bcb91139 100644 --- a/man/udev.xml +++ b/man/udev.xml @@ -793,7 +793,8 @@ Type - The device type, as exposed by the udev property DEVTYPE. + The device type, as exposed by the udev property DEVTYPE, or + ethernet to match a device without a DEVTYPE. diff --git a/src/shared/net-util.c b/src/shared/net-util.c index 8f8cfc9fd..85278e5de 100644 --- a/src/shared/net-util.c +++ b/src/shared/net-util.c @@ -49,7 +49,7 @@ bool net_match_config(const struct ether_addr *match_mac, if (match_driver && !streq_ptr(match_driver, dev_driver)) return 0; - if (match_type && !streq_ptr(match_type, dev_type)) + if (match_type && !streq_ptr(match_type, dev_type) && !(streq(match_type, "ethernet") && !dev_type)) return 0; if (match_name && !streq_ptr(match_name, dev_name))