Skip to content

Commit

Permalink
fix some reviews
Browse files Browse the repository at this point in the history
fix some review
  • Loading branch information
xanoxes authored Oct 14, 2024
1 parent b38e51c commit 6f6c398
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions network-scripts/ifup-eth
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,23 @@ else

if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then
if [ "${REALDEVICE}" != "lo" ] && ! is_false "${arpcheck[$idx]}"; then
while [ $tries -le $ARPING_TRIES ]
do
while [ "${tries}" -le "${ARPING_TRIES}" ]; do
ARPING=$(/sbin/arping -c 2 -w ${ARPING_WAIT:-3} -D -I ${REALDEVICE} ${ipaddr[$idx]})
if [ $? = 1 ]; then
ARPINGMAC=$(echo $ARPING | sed -ne 's/.*\[\(.*\)\].*/\1/p')
net_log $"Error, some other host ($ARPINGMAC) already uses address ${ipaddr[$idx]}."
tries=$((tries+1))
if [ $tries -gt $ARPING_TRIES ]
then
net_log "arping failed after $tries tries"
exit 1
if [ -n "${ARPINGMAC}" ]; then
net_log $"Error, some other host ($ARPINGMAC) already uses address ${ipaddr[$idx]}."
break
fi
tries=$((tries+1))
else
break
fi
done
if [ "${tries}" -gt "${ARPING_TRIES}" ]; then
net_log $"arping failed after $tries tries"
exit 1
fi
fi

if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \
Expand Down

0 comments on commit 6f6c398

Please sign in to comment.