]> git.ipfire.org Git - network.git/commitdiff
hotplug: Do not attempt to rename any devices with an invalid MAC address
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 18:34:59 +0000 (20:34 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 18:34:59 +0000 (20:34 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/udev/network-hotplug-rename

index 25091649b608d5fe6c601a279b7045db1db805a6..903a07ca2725b04e00911ae2faa99243400c1f09 100644 (file)
@@ -46,6 +46,14 @@ fi
 
 # Everything is wrapped into a function so that we can use locking on it
 main() {
+       # Check if the device has a unique MAC address (which is
+       # what are using to uniquely identify an interface)
+       local address="$(device_get_address "${INTERFACE}")"
+       if isset address && [ "${address}" = "00:00:00:00:00:00" ]; then
+               log DEBUG "Ignoring interface ${INTERFACE} with invalid MAC address ${address}"
+               return ${EXIT_OK}
+       fi
+
        # Determine the type of the device and then see what
        # we need to do with it.
        local type="$(device_get_type "${INTERFACE}")"