fix compile warning with implicit declaration of function 'icmp_reply'

Signed-off-by: daichuan <daichuan@xiaomi.com>
This commit is contained in:
daichuan 2024-09-03 15:11:21 +08:00 committed by Xiang Xiao
parent eebe18b802
commit c32c8da761
2 changed files with 7 additions and 4 deletions

View File

@ -498,8 +498,9 @@ int ipv4_filter_in(FAR struct net_driver_s *dev)
if (ret == IPFILTER_TARGET_REJECT)
{
/* TODO: Support more --reject-with types later. */
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
icmp_reply(dev, ICMP_DEST_UNREACHABLE, ICMP_NET_UNREACH);
#endif
}
return ret;
@ -567,7 +568,9 @@ void ipfilter_out(FAR struct net_driver_s *dev)
if (ret == IPFILTER_TARGET_REJECT)
{
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
icmp_reply(dev, ICMP_DEST_UNREACHABLE, ICMP_NET_UNREACH);
#endif
}
}
#endif

View File

@ -459,7 +459,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4)
in_addr_t srcipaddr;
FAR struct net_driver_s *fwddev;
int ret;
#ifdef CONFIG_NET_ICMP
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
int icmp_reply_type;
int icmp_reply_code;
#endif /* CONFIG_NET_ICMP */
@ -526,7 +526,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4)
drop:
ipv4_dropstats(ipv4);
#ifdef CONFIG_NET_ICMP
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
/* Reply ICMP to the sender for particular errors. */
switch (ret)
@ -554,7 +554,7 @@ drop:
dev->d_len = 0;
return ret;
#ifdef CONFIG_NET_ICMP
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
reply:
# ifdef CONFIG_NET_NAT44
/* Before we reply ICMP, call NAT outbound to try to translate destination