IP forwarding: Add missing ICMP support.

This commit is contained in:
Gregory Nutt
2017-07-06 07:49:55 -06:00
parent 04716a65a5
commit efdc5b0c29
6 changed files with 335 additions and 63 deletions
+11 -2
View File
@@ -156,7 +156,7 @@ static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4)
{
#ifdef CONFIG_NET_ICMP
/* Return an ICMP error packet back to the sender. */
#warning Missing logic
# warning Missing logic
#endif
/* Return zero which must cause the packet to be dropped */
@@ -413,7 +413,16 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev,
break;
#endif
case IP_PROTO_ICMP: /* Not yet supported */
#ifdef CONFIG_NET_ICMP
case IP_PROTO_ICMP:
{
/* Forward an ICMP packet */
ret = icmp_forward(fwd);
}
break;
#endif
default:
nwarn("WARNING: Unrecognized proto: %u\n", ipv4->proto);
ret = -EPROTONOSUPPORT;
+1 -1
View File
@@ -218,7 +218,7 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6)
{
#ifdef CONFIG_NET_ICMPv6
/* Return an ICMPv6 error packet back to the sender. */
#warning Missing logic
# warning Missing logic
#endif
/* Return zero which must cause the packet to be dropped */