aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2011-04-12 14:28:39 +0200
committerPetr Lautrbach <plautrba@redhat.com>2011-08-15 10:03:40 +0200
commitf2143135563b540867407ce5b7f6dc692fc5bb27 (patch)
tree928910eb16fa4d9dc46f6b9cdb06cb12baee79db
parentb37b2cee81ba4633e865621bfb73c7910584edd0 (diff)
downloadinitscripts-f2143135563b540867407ce5b7f6dc692fc5bb27.tar
initscripts-f2143135563b540867407ce5b7f6dc692fc5bb27.tar.gz
initscripts-f2143135563b540867407ce5b7f6dc692fc5bb27.tar.bz2
initscripts-f2143135563b540867407ce5b7f6dc692fc5bb27.tar.xz
initscripts-f2143135563b540867407ce5b7f6dc692fc5bb27.zip
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
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth21
-rwxr-xr-xsysconfig/network-scripts/ifup-eth10
2 files changed, 27 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index d9a5b43a..ca570cd4 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -57,8 +57,25 @@ if is_bonding_device ${DEVICE} ; then
is_ignored_file "$device" && continue
/sbin/ifdown ${device##*/}
done
- for target in $(cat /sys/class/net/${DEVICE}/bonding/arp_ip_target) ; do
- echo "-${target}" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
+ for arg in $BONDING_OPTS ; do
+ key=${arg%%=*};
+ [[ "${key}" != "arp_ip_target" ]] || continue
+ value=${arg##*=};
+ if [ "${value:0:1}" != "" ]; then
+ OLDIFS=$IFS;
+ IFS=',';
+ for arp_ip in $value; do
+ if grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/arp_ip_target; then
+ echo "-$arp_ip" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
+ fi
+ done
+ IFS=$OLDIFS;
+ else
+ value=${value#};
+ if grep -q $value /sys/class/net/${DEVICE}/bonding/arp_ip_target; then
+ echo "-$value" > /sys/class/net/${DEVICE}/bonding/arp_ip_target
+ fi
+ fi
done
fi
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 63ee1030..3658bd36 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -125,10 +125,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