mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
UDP networking: The TTL (time to live) was not being set in the IPv4 or IPv6 header unless the UDP socket was bound.
This commit is contained in:
@@ -106,18 +106,20 @@ static int ipv6_packet_conversion(FAR struct net_driver_s *dev,
|
||||
{
|
||||
/* Otherwise, we will have to drop the packet */
|
||||
|
||||
nwarn("WARNING: Dropping. Unsupported 6LoWPAN protocol: %d\n",
|
||||
nwarn("WARNING: Dropping. Unsupported 6LoWPAN protocol: %d\n",
|
||||
ipv6->proto);
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ipv6.drop++;
|
||||
#endif
|
||||
return -EPROTONOSUPPORT;
|
||||
}
|
||||
|
||||
dev->d_len = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
nwarn("WARNING: Dropping. Unsupported link layer\n");
|
||||
return -EPFNOSUPPORT;
|
||||
}
|
||||
#else
|
||||
@@ -515,6 +517,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6)
|
||||
ret = ipv6_decr_ttl(ipv6);
|
||||
if (ret < 1)
|
||||
{
|
||||
nwarn("WARNING: Hop limit exceeded... Dropping!\n");
|
||||
ret = -EMULTIHOP;
|
||||
goto drop;
|
||||
}
|
||||
@@ -548,6 +551,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6)
|
||||
ret = ipv6_dev_forward(dev, fwddev, ipv6);
|
||||
if (ret < 0)
|
||||
{
|
||||
nwarn("WARNING: ipv6_dev_forward faield: %d\n", ret);
|
||||
goto drop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,6 +370,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
||||
{
|
||||
/* Not destined for us and not forwardable... drop the packet. */
|
||||
|
||||
nwarn("WARNING: Not destined for us; not forwardable... Dropping!\n");
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.ipv6.drop++;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user