diff options
-rw-r--r-- | sysconfig/network-scripts/network-functions | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 1b31f999..b15028b5 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -422,29 +422,31 @@ install_bonding_driver () # Set config here need_config "$1" source_config - /sbin/ip link set dev ${DEVICE} down - - # add the bits to setup driver parameters here - for arg in $BONDING_OPTS ; do - key=${arg%%=*}; - value=${arg##*=}; - if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then - OLDIFS=$IFS; - IFS=','; - for arp_ip in $value; do - if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then - echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key - fi - done - IFS=$OLDIFS; - elif [ "${key}" = "arp_ip_target" ]; then - if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then - echo "$value" > /sys/class/net/${DEVICE}/bonding/$key - fi - elif [ "${key}" != "primary" ]; then - echo $value > /sys/class/net/${DEVICE}/bonding/$key - fi - done + if [ -f /sys/class/net/${DEVICE}/bonding/slaves -a $(wc -l < /sys/class/net/${DEVICE}/bonding/slaves) -eq 0 ]; then + /sbin/ip link set dev ${DEVICE} down + + # add the bits to setup driver parameters here + for arg in $BONDING_OPTS ; do + key=${arg%%=*}; + value=${arg##*=}; + if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then + OLDIFS=$IFS; + IFS=','; + for arp_ip in $value; do + if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then + echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key + fi + done + IFS=$OLDIFS; + elif [ "${key}" = "arp_ip_target" ]; then + if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then + echo "$value" > /sys/class/net/${DEVICE}/bonding/$key + fi + elif [ "${key}" != "primary" ]; then + echo $value > /sys/class/net/${DEVICE}/bonding/$key + fi + done + fi ) return 0 } |