net/arp: add timeout to avoid infinite send wait
add timeout to avoid infinite send wait if the network device is unreachable Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
4abf8e6587
commit
9bdf4ccd68
@ -337,7 +337,12 @@ int arp_send(in_addr_t ipaddr)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
net_lockedwait(&state.snd_sem);
|
ret = net_timedwait_uninterruptible(&state.snd_sem,
|
||||||
|
CONFIG_ARP_SEND_DELAYMSEC);
|
||||||
|
if (ret == -ETIMEDOUT)
|
||||||
|
{
|
||||||
|
goto timeout;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while (!state.snd_sent);
|
while (!state.snd_sent);
|
||||||
|
|
||||||
@ -367,6 +372,8 @@ int arp_send(in_addr_t ipaddr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeout:
|
||||||
|
|
||||||
/* Increment the retry count */
|
/* Increment the retry count */
|
||||||
|
|
||||||
state.snd_retries++;
|
state.snd_retries++;
|
||||||
|
Loading…
Reference in New Issue
Block a user