aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2016-01-05 13:35:21 +0100
committerDee'Kej <deekej@linuxmail.org>2016-10-31 15:50:38 +0100
commitb6a3a1dd5d783229a2bb6e42993fe6b09e0583d2 (patch)
tree9aa0a9ed59f46adf2d8221b1346ca80d51e52446 /sysconfig/network-scripts
parentb4bc3909d253b3211b01bee3a70c43cab3c58861 (diff)
downloadinitscripts-b6a3a1dd5d783229a2bb6e42993fe6b09e0583d2.tar
initscripts-b6a3a1dd5d783229a2bb6e42993fe6b09e0583d2.tar.gz
initscripts-b6a3a1dd5d783229a2bb6e42993fe6b09e0583d2.tar.bz2
initscripts-b6a3a1dd5d783229a2bb6e42993fe6b09e0583d2.tar.xz
initscripts-b6a3a1dd5d783229a2bb6e42993fe6b09e0583d2.zip
ifup-eth: if arping fails, output responding MAC
Resolves: #1099026
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases5
-rwxr-xr-xsysconfig/network-scripts/ifup-eth5
2 files changed, 6 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index ad44964b..fbc15470 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -267,9 +267,10 @@ function new_interface ()
is_available ${parent_device} && \
( 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}..."
- /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR}
+ ARPING=$(/sbin/arping -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR})
if [ $? = 1 ]; then
- net_log $"Error, some other host already uses address ${IPADDR}."
+ ARPINGMAC=$(echo $ARPING | sed -ne 's/.*\[\(.*\)\].*/\1/p')
+ net_log $"Error, some other host ($ARPINGMAC) already uses address ${IPADDR}."
return 1
fi
fi
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 8130b3cb..4d022f76 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -251,9 +251,10 @@ else
if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then
if [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] ; then
- /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${REALDEVICE} ${ipaddr[$idx]}
+ ARPING=$(/sbin/arping -c 2 -w ${ARPING_WAIT:-3} -D -I ${REALDEVICE} ${ipaddr[$idx]})
if [ $? = 1 ]; then
- net_log $"Error, some other host already uses address ${ipaddr[$idx]}."
+ ARPINGMAC=$(echo $ARPING | sed -ne 's/.*\[\(.*\)\].*/\1/p')
+ net_log $"Error, some other host ($ARPINGMAC) already uses address ${ipaddr[$idx]}."
exit 1
fi
fi