mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
net/nat: g_nat_lock can be used recursively
case: when rndis receive a packet and this packet is going to be forwarded. 1. first lock happen when ipv4_dev_forward call ipv4_nat_outbound; 2. next lock is: ipv4_nat_outbound_entry_find --> nat_port_select --> tcp_selectport --> nat_port_inuse Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
This commit is contained in:
parent
0705828024
commit
db572d860b
1 changed files with 3 additions and 3 deletions
|
|
@ -42,7 +42,7 @@
|
|||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static mutex_t g_nat_lock = NXMUTEX_INITIALIZER;
|
||||
static rmutex_t g_nat_lock = NXRMUTEX_INITIALIZER;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
|
@ -418,7 +418,7 @@ uint32_t nat_expire_time(uint8_t protocol)
|
|||
|
||||
void nat_lock(void)
|
||||
{
|
||||
nxmutex_lock(&g_nat_lock);
|
||||
nxrmutex_lock(&g_nat_lock);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -431,7 +431,7 @@ void nat_lock(void)
|
|||
|
||||
void nat_unlock(void)
|
||||
{
|
||||
nxmutex_unlock(&g_nat_lock);
|
||||
nxrmutex_unlock(&g_nat_lock);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET_NAT */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue