]> git.ipfire.org Git - people/ms/network.git/commitdiff
Restart ports after edit to apply settings
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Sep 2018 21:42:54 +0000 (22:42 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Sep 2018 21:42:54 +0000 (22:42 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/header-port
src/hooks/ports/ethernet

index 158a7cb7eb9b018b590b69dbbdbfc1b17c45fb0f..489958fa276745e23fcc910a8e8ef22a75303fc2 100644 (file)
@@ -81,6 +81,9 @@ hook_default_edit() {
                return ${EXIT_ERROR}
        fi
 
+       # Apply settings
+       port_restart "${port}"
+
        return ${EXIT_OK}
 }
 
index 6f4ac68afc8f7b977e6bf354422568ca2647e0b9..ce48ecdd4967428f17586aa29adc96325ce829e7 100644 (file)
@@ -68,8 +68,13 @@ hook_new() {
 }
 
 hook_create() {
-       # Nothing to do here. Real ethernet devices cannot
-       # be created. They are just there.
+       local port="${1}"
+
+       # Set MAC address, if needed
+       if isset ADDRESS; then
+               device_set_address "${port}" "${ADDRESS}"
+       fi
+
        exit ${EXIT_OK}
 }
 
@@ -95,13 +100,7 @@ hook_hotplug_rename() {
        if list_match "${address}" ${DEVICE} ${ADDRESS}; then
                log DEBUG "Device '${device}' equals port '${port}'."
 
-               # Change the MAC address, if needed.
-               if isset ADDRESS; then
-                       device_set_address "${device}" "${ADDRESS}"
-               fi
-
-               # Everything is done.
-               exit ${EXIT_OK}
+               hook_create "${device}"
        fi
 
        log DEBUG "Device '${device}' does not equal port '${port}'."