Skip to content

Commit

Permalink
use for loop instead of while & init the tries and ARPING_TRIES
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Macku <[email protected]>
  • Loading branch information
xanoxes and jamacku authored Dec 23, 2024
1 parent 3811fff commit 450a603
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion network-scripts/ifup-eth
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ 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
for (( tries=0; tries<${ARPING_TRIES:=1}; tries++ )); do
ARPING=$(/sbin/arping -c 2 -w ${ARPING_WAIT:-3} -D -I ${REALDEVICE} ${ipaddr[$idx]})
[ $? = 0 ] && break
ARPINGMAC=$(echo $ARPING | sed -ne 's/.*\[\(.*\)\].*/\1/p')
Expand Down

0 comments on commit 450a603

Please sign in to comment.