File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -293,10 +293,18 @@ 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+ while [ " ${tries} " -le " ${ARPING_TRIES} " ]; do
297+ ARPING=$( /sbin/arping -c 2 -w ${ARPING_WAIT:- 3} -D -I ${REALDEVICE} ${ipaddr[$idx]} )
298+ [ $? = 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+ tries=$(( tries+ 1 ))
305+ done
306+ if [ " ${tries} " -gt " ${ARPING_TRIES} " ]; then
307+ net_log $" arping failed after $tries tries"
300308 exit 1
301309 fi
302310 fi
You can’t perform that action at this time.
0 commit comments