Networking: Final fixes. IPv6 pings now work in both directions
This commit is contained in:
parent
8e844a3c27
commit
e02ced8c98
@ -171,14 +171,11 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
||||
* we set d_len to the correct value.
|
||||
*
|
||||
* The length reported in the IPv6 header is the length of the payload
|
||||
* that follows the header. However, uIP uses the d_len variable for
|
||||
* holding the size of the entire packet, including the IP header. For
|
||||
* IPv4 this is not a problem as the length field in the IPv4 header
|
||||
* contains the length of the entire packet. But for IPv6 we need to add
|
||||
* the size of the IPv6 header (40 bytes).
|
||||
* that follows the header. The device interface uses the d_len variable for
|
||||
* holding the size of the entire packet, including the IP header.
|
||||
*/
|
||||
|
||||
iplen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN;
|
||||
iplen = (ipv6->len[0] << 8) + ipv6->len[1] + IPv6_HDRLEN + ETH_HDRLEN;
|
||||
if (iplen <= dev->d_len)
|
||||
{
|
||||
dev->d_len = iplen;
|
||||
|
@ -145,7 +145,7 @@ void icmpv6_input(FAR struct net_driver_s *dev)
|
||||
*
|
||||
*
|
||||
* Set up the IPv6 header. Most is probably already in place from
|
||||
* the Neighbor Solitication. We could save some time here.
|
||||
* the Neighbor Solicitation. We could save some time here.
|
||||
*/
|
||||
|
||||
icmp->vtc = 0x60; /* Version/traffic class (MS) */
|
||||
@ -224,6 +224,11 @@ void icmpv6_input(FAR struct net_driver_s *dev)
|
||||
eth->type = HTONS(ETHTYPE_IP6);
|
||||
}
|
||||
#endif
|
||||
/* No additional neighbor lookup is required on this packet
|
||||
* (We are using a multicast address).
|
||||
*/
|
||||
|
||||
IFF_SET_NOARP(dev->d_flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -320,10 +325,6 @@ void icmpv6_input(FAR struct net_driver_s *dev)
|
||||
goto icmpv6_type_error;
|
||||
}
|
||||
|
||||
/* No additional neighbor lookup is required on this packet. */
|
||||
|
||||
IFF_SET_NOARP(dev->d_flags);
|
||||
|
||||
nllvdbg("Outgoing ICMPv6 packet length: %d (%d)\n",
|
||||
dev->d_len, (icmp->len[0] << 8) | icmp->len[1]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user