net/nat: Remove unnecessary logic in inbound logic

Finish https://github.com/apache/nuttx/pull/12116#discussion_r1560880897

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng 2024-04-12 10:21:44 +08:00 committed by Alin Jerpelea
parent 17584eaa4f
commit 932c41debb
2 changed files with 2 additions and 16 deletions

View File

@ -744,14 +744,7 @@ void ipv4_nat_inbound(FAR struct net_driver_s *dev,
if (IFF_IS_NAT(dev->d_flags) &&
net_ipv4addr_hdrcmp(ipv4->destipaddr, &dev->d_ipaddr))
{
FAR ipv4_nat_entry_t *entry =
ipv4_nat_inbound_internal(ipv4, NAT_MANIP_DST);
if (!entry)
{
/* Inbound without entry is OK (e.g. towards NuttX itself), skip. */
return;
}
}
}

View File

@ -634,14 +634,7 @@ void ipv6_nat_inbound(FAR struct net_driver_s *dev,
if (IFF_IS_NAT(dev->d_flags) &&
NETDEV_IS_MY_V6ADDR(dev, ipv6->destipaddr))
{
FAR ipv6_nat_entry_t *entry =
ipv6_nat_inbound_internal(ipv6, NAT_MANIP_DST);
if (!entry)
{
/* Inbound without entry is OK (e.g. towards NuttX itself), skip. */
return;
}
}
}