mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
net/nat: Unlock on outbound NAT entry creation failure.
Release nat_lock before returning -ENOENT from the IPv4 and IPv6 outbound NAT paths when NAT entry creation fails. Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
This commit is contained in:
committed by
Matteo Golin
parent
78e3f17b9e
commit
1e6c751db7
@@ -795,6 +795,7 @@ int ipv4_nat_outbound(FAR struct net_driver_s *dev,
|
|||||||
{
|
{
|
||||||
/* Outbound entry creation failed, should have entry. */
|
/* Outbound entry creation failed, should have entry. */
|
||||||
|
|
||||||
|
nat_unlock();
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -683,6 +683,7 @@ int ipv6_nat_outbound(FAR struct net_driver_s *dev,
|
|||||||
{
|
{
|
||||||
/* Outbound entry creation failed, should have entry. */
|
/* Outbound entry creation failed, should have entry. */
|
||||||
|
|
||||||
|
nat_unlock();
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user