]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Use MAC addresses to define a slave
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 31 Dec 2016 14:03:32 +0000 (15:03 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 31 Dec 2016 14:05:54 +0000 (14:05 +0000)
It is now also possible to use the MAC address to define a slave of a
bridge.
Simply add the mac address to the ZONE_SLAVES=''.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/udev/network-hotplug-bridges

index ff6d20a8b2be69837a8f3eeb433bf225bf85a487..514b45de128b99197fa22ebfa15022e665bbacaa 100644 (file)
@@ -40,7 +40,9 @@ detect_zone() {
                # Try to find out if this INTERFACE is a slave of a zone
                local slave
                for slave in $(get_value "${zone}_SLAVES"); do
-                       if [ "${INTERFACE}" = "${slave}" ]; then
+
+                       #Compare if the mac address matches or if the name matches
+                       if ([ "$(</sys/class/net/${INTERFACE}/address)" = "${slave}" ] || [ "${INTERFACE}" = "${slave}" ]); then
                                echo "${zone}"
                                return 0
                        fi