mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
6LoWPAN: Fix a src/dest address confusion
This commit is contained in:
@@ -766,11 +766,11 @@ void sixlowpan_compresshdr_hc06(FAR struct ieee802154_driver_s *ieee,
|
||||
SIXLOWPAN_IPHC_SAM_BIT);
|
||||
}
|
||||
|
||||
/* No address context found for this address */
|
||||
/* No address context found for the source address */
|
||||
|
||||
else if (net_is_addr_linklocal(ipv6->srcipaddr) &&
|
||||
ipv6->destipaddr[1] == 0 && ipv6->destipaddr[2] == 0 &&
|
||||
ipv6->destipaddr[3] == 0)
|
||||
ipv6->srcipaddr[1] == 0 && ipv6->srcipaddr[2] == 0 &&
|
||||
ipv6->srcipaddr[3] == 0)
|
||||
{
|
||||
iphc1 |= compress_laddr(ipv6->srcipaddr,
|
||||
&ieee->i_dev.d_mac.ieee802154,
|
||||
@@ -778,7 +778,7 @@ void sixlowpan_compresshdr_hc06(FAR struct ieee802154_driver_s *ieee,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Send the full address ipaddr: SAC = 0, SAM = 00 */
|
||||
/* Send the full source address ipaddr: SAC = 0, SAM = 00 */
|
||||
|
||||
ninfo("Uncompressable srcipaddr=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
|
||||
ipv6->srcipaddr[0], ipv6->srcipaddr[1], ipv6->srcipaddr[2],
|
||||
|
||||
@@ -223,7 +223,7 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
|
||||
if (dev == NULL)
|
||||
#endif
|
||||
{
|
||||
nwarn("WARNING: Not routable\n");
|
||||
nwarn("WARNING: Not routable or not IEEE802.15.4 MAC\n");
|
||||
return (ssize_t)-ENETUNREACH;
|
||||
}
|
||||
#endif
|
||||
@@ -260,6 +260,8 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
|
||||
net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr, to6->sin6_addr.in6_u.u6_addr16);
|
||||
#ifdef CONFIG_NETDEV_MULTINIC
|
||||
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr);
|
||||
#else
|
||||
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, dev->d_ipv6addr);
|
||||
#endif
|
||||
|
||||
ninfo("IPv6 length: %d\n",
|
||||
|
||||
Reference in New Issue
Block a user