chiark / gitweb /
net-util: add support for Type=ethernet
authorTom Gundersen <teg@jklm.no>
Fri, 3 Jan 2014 19:55:23 +0000 (20:55 +0100)
committerTom Gundersen <teg@jklm.no>
Fri, 3 Jan 2014 19:55:23 +0000 (20:55 +0100)
When DEVTYPE is not set for a nic, it means it is a wired/ethernet
device.

man/systemd-networkd.service.xml
man/udev.xml
src/shared/net-util.c

index 908354c..f38e813 100644 (file)
                                         <term><varname>Type</varname></term>
                                         <listitem>
                                                 <para>The device type, as exposed by the udev property
-                                                <literal>DEVTYPE</literal>.</para>
+                                                <literal>DEVTYPE</literal>, or <literal>ethernet</literal>
+                                                to match devices without a <literal>DEVTYPE</literal>.</para>
                                         </listitem>
                                 </varlistentry>
                                 <varlistentry>
index 32a520e..0bcb911 100644 (file)
         <varlistentry>
           <term><varname>Type</varname></term>
           <listitem>
-            <para>The device type, as exposed by the udev property <literal>DEVTYPE</literal>.</para>
+            <para>The device type, as exposed by the udev property <literal>DEVTYPE</literal>, or
+            <literal>ethernet</literal> to match a device without a <literal>DEVTYPE</literal>.</para>
           </listitem>
         </varlistentry>
       </variablelist>
index 8f8cfc9..85278e5 100644 (file)
@@ -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))