]> TLD Linux GIT Repositories - rc-scripts.git/blobdiff - lib/ifup
- merged inteface bonding fixes (use sysfs instead of deprecated ifenslave)
[rc-scripts.git] / lib / ifup
index c53444235e1b2f49ee6c3cbdc073e686e48afa35..4f5d2e71f9e47104b0581bbdf5598610e1e725b2 100755 (executable)
--- a/lib/ifup
+++ b/lib/ifup
@@ -120,11 +120,12 @@ if [ -n "$ETHTOOL_OPTS" ] ; then
 fi
 
 if is_yes "$SLAVE" && [ -n "$MASTER" ] ; then
-    nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
-    ip link set "$DEVICE" master "$MASTER"
-    ip link set "$DEVICE" up
-
-    exit 0
+       if ! grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null; then
+               nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
+               ip link set dev ${DEVICE} down
+               echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
+       fi
+       exit 0
 fi
 
 if [ "$HANDLING" = "2" ]; then