mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 13:08:26 +00:00
net/arp: Fix memory corruption in arp_send()
Summary: - In arp_send(), arp_wait_setup() adds a notify object to g_arp_waiters which is removed in arp_wait() in normal case. - However, in timeout and error cases, the object was not removed and caused memory corruption. - This commit fixes this issue. Impact: - None Testing: - Tested with spresense:rndis_smp Change-Id: I55e56661b7ff665171805af9106f3a04cc2c3cad Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
903d472f78
commit
09bdee7713
1 changed files with 2 additions and 0 deletions
|
|
@ -341,6 +341,7 @@ int arp_send(in_addr_t ipaddr)
|
|||
CONFIG_ARP_SEND_DELAYMSEC);
|
||||
if (ret == -ETIMEDOUT)
|
||||
{
|
||||
arp_wait_cancel(¬ify);
|
||||
goto timeout;
|
||||
}
|
||||
}
|
||||
|
|
@ -354,6 +355,7 @@ int arp_send(in_addr_t ipaddr)
|
|||
/* Break out on a send failure */
|
||||
|
||||
nerr("ERROR: Send failed: %d\n", ret);
|
||||
arp_wait_cancel(¬ify);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue