File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -293,10 +293,17 @@ else
293293
294294 if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q " ${ipaddr[$idx]} /${prefix[$idx]} " ; then
295295 if [ " ${REALDEVICE} " != " lo" ] && ! is_false " ${arpcheck[$idx]} " ; then
296- ARPING=$( /sbin/arping -c 2 -w ${ARPING_WAIT:- 3} -D -I ${REALDEVICE} ${ipaddr[$idx]} )
297- if [ $? = 1 ]; then
296+ for (( tries= 0 ; tries< ${ARPING_TRIES:= 1} ; tries++ )) ; do
297+ ARPING=$( /sbin/arping -c 2 -w ${ARPING_WAIT:- 3} -D -I ${REALDEVICE} ${ipaddr[$idx]} )
298+ [ " $? " -eq 0 ] && break
298299 ARPINGMAC=$( echo $ARPING | sed -ne ' s/.*\[\(.*\)\].*/\1/p' )
299- net_log $" Error, some other host ($ARPINGMAC ) already uses address ${ipaddr[$idx]} ."
300+ if [ -n " ${ARPINGMAC} " ]; then
301+ net_log $" Error, some other host ($ARPINGMAC ) already uses address ${ipaddr[$idx]} ."
302+ exit 1
303+ fi
304+ done
305+ if [ " ${tries} " -eq " ${ARPING_TRIES} " ]; then
306+ net_log $" arping failed after $tries tries"
300307 exit 1
301308 fi
302309 fi
You can’t perform that action at this time.
0 commit comments