aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2014-07-24 14:55:55 +0200
committerLukas Nykryn <lnykryn@redhat.com>2014-07-24 14:56:02 +0200
commit34a84d9e9db6b1732d35f0752b2d7e833ce6b338 (patch)
tree07dc8be7c5573edb18640d3e77d0363b59d8bbcd /sysconfig/network-scripts
parent0a56b2cc22e7ee4e2e8ea926fc0ff81cbc299d34 (diff)
downloadinitscripts-34a84d9e9db6b1732d35f0752b2d7e833ce6b338.tar
initscripts-34a84d9e9db6b1732d35f0752b2d7e833ce6b338.tar.gz
initscripts-34a84d9e9db6b1732d35f0752b2d7e833ce6b338.tar.bz2
initscripts-34a84d9e9db6b1732d35f0752b2d7e833ce6b338.tar.xz
initscripts-34a84d9e9db6b1732d35f0752b2d7e833ce6b338.zip
ifup-aliases: improve duplicate address detection
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases14
1 files changed, 8 insertions, 6 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index c92a431d..b821eee8 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -257,13 +257,15 @@ function new_interface ()
fi
if [ "$setup_this" = "yes" ] ; then
- [ "${parent_device}" != "lo" ] && [ "${ARPCHECK}" != "no" ] && \
+ if [ "${parent_device}" != "lo" ] && [ "${ARPCHECK}" != "no" ] && \
is_available ${parent_device} && \
- grep -qswi "up" /sys/class/net/${parent_device}/operstate && \
- if ! /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR} ; then
- net_log $"Error, some other host already uses address ${IPADDR}."
- return 1
- fi
+ ( grep -qswi "up" /sys/class/net/${parent_device}/operstate || grep -qswi "1" /sys/class/net/${parent_device}/carrier ) ; then
+ echo $"Determining if ip address ${IPADDR} is already in use for device ${parent_device}..."
+ if ! /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR} ; then
+ net_log $"Error, some other host already uses address ${IPADDR}."
+ return 1
+ fi
+ fi
/sbin/ip addr add ${IPADDR}/${PREFIX} brd ${BROADCAST} dev ${parent_device} label ${DEVICE}