mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
net/arp: add timeout to avoid infinite send wait
add timeout to avoid infinite send wait if the network device is unreachable Change-Id: I839a5fe1fb64b7d6eee7ad28d93d2b27f067b915 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
+7
-1
@@ -337,7 +337,12 @@ int arp_send(in_addr_t ipaddr)
|
||||
|
||||
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);
|
||||
|
||||
@@ -367,6 +372,7 @@ int arp_send(in_addr_t ipaddr)
|
||||
break;
|
||||
}
|
||||
|
||||
timeout:
|
||||
/* Increment the retry count */
|
||||
|
||||
state.snd_retries++;
|
||||
|
||||
Reference in New Issue
Block a user