]> git.ipfire.org Git - network.git/commitdiff
bonding: Fix setting mode.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 31 Oct 2011 19:34:09 +0000 (19:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 31 Oct 2011 19:34:09 +0000 (19:34 +0000)
The mode cannot be changed after the device is set up.
So we set the mode prior to bringing the device up.

functions.bonding
hooks/ports/bonding

index 74a4d09d94d5eec2960fa19682be6124b2c106d5..ff2841d4e19780163de484cd7f26b58b9413a271 100644 (file)
@@ -39,7 +39,6 @@ function bonding_create() {
 
        echo "+${device}" > /sys/class/net/bonding_masters
        device_set_address ${device} ${mac}
-       device_set_up ${device}
 }
 
 function bonding_remove() {
index 0a8535f66445cfb9f0402abd523fa35a3d4c9766..880d987e274c67de256672dacae5eb35214ffc14 100755 (executable)
@@ -110,12 +110,14 @@ function _up() {
        fi
 
        bonding_create ${device} ${DEVICE_MAC}
+       assert device_exists ${device}
 
        if [ -n "${MODE}" ]; then
                bonding_set_mode ${device} ${MODE}
        fi
 
        bonding_set_miimon ${device} ${MIIMON}
+       device_set_up ${device}
 
        local slave
        for slave in ${SLAVES}; do