From 5749d2e9d5795fdaf65b97befd64cf90103d423d Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 12 Apr 2011 14:28:39 +0200 Subject: ifup/ifdown-eth: properly add and remove arp_ip_target's Only add arp_ip_target, if not yet present. Only remove arp_ip_target, if present in BONDING_OPTS, to prevent clash with module options. https://bugzilla.redhat.com/show_bug.cgi?id=604669 --- sysconfig/network-scripts/ifup-eth | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sysconfig/network-scripts/ifup-eth') diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 836243a0..469a07fa 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -120,10 +120,16 @@ if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then OLDIFS=$IFS; IFS=','; for arp_ip in $value; do - echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key + 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; - else + 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 + else echo $value > /sys/class/net/${DEVICE}/bonding/$key fi done -- cgit v1.2.1