diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2013-07-23 15:52:47 +0200 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2013-07-23 15:52:47 +0200 |
commit | 8614e6466e1ee84a2f5882a7361c9ba8cfca82d4 (patch) | |
tree | b3625a945bdd53c2829e9424f84e3c12ba7db72e /sysconfig/network-scripts | |
parent | 94c6a8b314c9924956f2c9dd8df5895d5d3c96c3 (diff) | |
download | initscripts-8614e6466e1ee84a2f5882a7361c9ba8cfca82d4.tar initscripts-8614e6466e1ee84a2f5882a7361c9ba8cfca82d4.tar.gz initscripts-8614e6466e1ee84a2f5882a7361c9ba8cfca82d4.tar.bz2 initscripts-8614e6466e1ee84a2f5882a7361c9ba8cfca82d4.tar.xz initscripts-8614e6466e1ee84a2f5882a7361c9ba8cfca82d4.zip |
print something when arping is detecting colliding ip addresses
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifup-aliases | 14 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 12 |
2 files changed, 15 insertions, 11 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index 0cd9866f..3f794951 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -258,13 +258,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 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 ; then + echo $"Determining if ip address ${IPADDR} is already in use for device ${parent_device}..." + if ! /sbin/arping -q -c 2 -w 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} diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 26534cf0..b2973ff0 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -238,11 +238,13 @@ else fi if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then - [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \ - if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then - net_log $"Error, some other host already uses address ${ipaddr[$idx]}." - exit 1 - fi + if [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] ; then + echo $"Determining if ip address ${ipaddr[$idx]} is already in use for device ${REALDEVICE}..." + if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then + net_log $"Error, some other host already uses address ${ipaddr[$idx]}." + exit 1 + fi + fi if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \ brd ${broadcast[$idx]:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then |