diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2016-01-05 13:35:21 +0100 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2016-01-05 13:35:31 +0100 |
commit | 37e2084f437172353744b10cad600710137d87c6 (patch) | |
tree | 5765b3b2304bf19f6f4a579c6d1b5d9c9fe3fc78 /sysconfig | |
parent | cd475bf315b9c08e9f1732c0b9de95729025d1c5 (diff) | |
download | initscripts-37e2084f437172353744b10cad600710137d87c6.tar initscripts-37e2084f437172353744b10cad600710137d87c6.tar.gz initscripts-37e2084f437172353744b10cad600710137d87c6.tar.bz2 initscripts-37e2084f437172353744b10cad600710137d87c6.tar.xz initscripts-37e2084f437172353744b10cad600710137d87c6.zip |
ifup-eth: if arping fails, output responding MAC
Resolves: #1099026
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup-aliases | 5 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index 2b48f9c4..c47d6ef7 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -263,8 +263,9 @@ 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}..." - 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}." + if ! ARPING=$(/sbin/arping -c 2 -w ${ARPING_WAIT:-3} -D -I ${parent_device} ${IPADDR}) ; then + 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 97cff2d8..7f753a90 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -244,8 +244,9 @@ 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 echo $"Determining if ip address ${ipaddr[$idx]} is already in use for device ${REALDEVICE}..." - if ! /sbin/arping -q -c 2 -w ${ARPING_WAIT:-3} -D -I ${REALDEVICE} ${ipaddr[$idx]} ; then - net_log $"Error, some other host already uses address ${ipaddr[$idx]}." + if ! ARPING=$(/sbin/arping -c 2 -w ${ARPING_WAIT:-3} -D -I ${REALDEVICE} ${ipaddr[$idx]}) ; then + ARPINGMAC=$(echo $ARPING | sed -ne 's/.*\[\(.*\)\].*/\1/p') + net_log $"Error, some other host ($ARPINGMAC) already uses address ${ipaddr[$idx]}." exit 1 fi fi |