fix compile warning with implicit declaration of function 'icmp_reply'
Signed-off-by: daichuan <daichuan@xiaomi.com>
This commit is contained in:
parent
eebe18b802
commit
c32c8da761
2 changed files with 7 additions and 4 deletions
|
@ -498,8 +498,9 @@ int ipv4_filter_in(FAR struct net_driver_s *dev)
|
||||||
if (ret == IPFILTER_TARGET_REJECT)
|
if (ret == IPFILTER_TARGET_REJECT)
|
||||||
{
|
{
|
||||||
/* TODO: Support more --reject-with types later. */
|
/* 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);
|
icmp_reply(dev, ICMP_DEST_UNREACHABLE, ICMP_NET_UNREACH);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -567,7 +568,9 @@ void ipfilter_out(FAR struct net_driver_s *dev)
|
||||||
|
|
||||||
if (ret == IPFILTER_TARGET_REJECT)
|
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);
|
icmp_reply(dev, ICMP_DEST_UNREACHABLE, ICMP_NET_UNREACH);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -459,7 +459,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4)
|
||||||
in_addr_t srcipaddr;
|
in_addr_t srcipaddr;
|
||||||
FAR struct net_driver_s *fwddev;
|
FAR struct net_driver_s *fwddev;
|
||||||
int ret;
|
int ret;
|
||||||
#ifdef CONFIG_NET_ICMP
|
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
|
||||||
int icmp_reply_type;
|
int icmp_reply_type;
|
||||||
int icmp_reply_code;
|
int icmp_reply_code;
|
||||||
#endif /* CONFIG_NET_ICMP */
|
#endif /* CONFIG_NET_ICMP */
|
||||||
|
@ -526,7 +526,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4)
|
||||||
drop:
|
drop:
|
||||||
ipv4_dropstats(ipv4);
|
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. */
|
/* Reply ICMP to the sender for particular errors. */
|
||||||
|
|
||||||
switch (ret)
|
switch (ret)
|
||||||
|
@ -554,7 +554,7 @@ drop:
|
||||||
dev->d_len = 0;
|
dev->d_len = 0;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMP
|
#if defined(CONFIG_NET_ICMP) && !defined(CONFIG_NET_ICMP_NO_STACK)
|
||||||
reply:
|
reply:
|
||||||
# ifdef CONFIG_NET_NAT44
|
# ifdef CONFIG_NET_NAT44
|
||||||
/* Before we reply ICMP, call NAT outbound to try to translate destination
|
/* Before we reply ICMP, call NAT outbound to try to translate destination
|
||||||
|
|
Loading…
Reference in a new issue