6loWPAN: More fixes from early debug.

This commit is contained in:
Gregory Nutt
2017-04-03 15:25:36 -06:00
parent 2c06f8ab78
commit 7cb34d969d
9 changed files with 138 additions and 38 deletions
+14 -5
View File
@@ -500,16 +500,14 @@ CONFIG_NET=y
# #
# Driver buffer configuration # Driver buffer configuration
# #
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=536
CONFIG_NET_GUARDSIZE=2 CONFIG_NET_GUARDSIZE=2
# #
# Data link support # Data link support
# #
CONFIG_NET_MULTILINK=y # CONFIG_NET_MULTILINK is not set
# CONFIG_NET_USER_DEVFMT is not set # CONFIG_NET_USER_DEVFMT is not set
CONFIG_NET_ETHERNET=y # CONFIG_NET_ETHERNET is not set
CONFIG_NET_6LOWPAN=y CONFIG_NET_6LOWPAN=y
# CONFIG_NET_LOOPBACK is not set # CONFIG_NET_LOOPBACK is not set
# CONFIG_NET_TUN is not set # CONFIG_NET_TUN is not set
@@ -884,6 +882,17 @@ CONFIG_EXAMPLES_NETTEST_IPv6=y
# #
# Target IPv6 address # Target IPv6 address
# #
#
# Client IPv6 address
#
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_1=0xfe80
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_2=0x0000
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_3=0x0000
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_4=0x0000
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_5=0x1234
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_6=0x0000
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_7=0x0000
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_8=0x0000
CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NULL is not set
# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NX is not set
@@ -1112,7 +1121,7 @@ CONFIG_NSH_IPv6NETMASK_1=0xffff
CONFIG_NSH_IPv6NETMASK_2=0xffff CONFIG_NSH_IPv6NETMASK_2=0xffff
CONFIG_NSH_IPv6NETMASK_3=0xffff CONFIG_NSH_IPv6NETMASK_3=0xffff
CONFIG_NSH_IPv6NETMASK_4=0xffff CONFIG_NSH_IPv6NETMASK_4=0xffff
CONFIG_NSH_IPv6NETMASK_5=0xffff CONFIG_NSH_IPv6NETMASK_5=0x0000
CONFIG_NSH_IPv6NETMASK_6=0x0000 CONFIG_NSH_IPv6NETMASK_6=0x0000
CONFIG_NSH_IPv6NETMASK_7=0x0000 CONFIG_NSH_IPv6NETMASK_7=0x0000
CONFIG_NSH_IPv6NETMASK_8=0x0000 CONFIG_NSH_IPv6NETMASK_8=0x0000
+7 -7
View File
@@ -547,7 +547,7 @@ bool net_ipv6addr_maskcmp(const net_ipv6addr_t addr1,
#define net_is_addr_loopback(a) \ #define net_is_addr_loopback(a) \
((a)[0] == 0 && (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ ((a)[0] == 0 && (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && (a)[7] == 0x0001) (a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && (a)[7] == HTONS(0x0001))
/**************************************************************************** /****************************************************************************
* Name: net_is_addr_unspecified * Name: net_is_addr_unspecified
@@ -569,7 +569,7 @@ bool net_ipv6addr_maskcmp(const net_ipv6addr_t addr1,
* *
****************************************************************************/ ****************************************************************************/
#define net_is_addr_mcast(a) (((a)[0] & 0xff00) == 0xff00) #define net_is_addr_mcast(a) (((a)[0] & HTONS(0xff00)) == HTONS(0xff00))
/**************************************************************************** /****************************************************************************
* Name: net_is_addr_linklocal_allnodes_mcast * Name: net_is_addr_linklocal_allnodes_mcast
@@ -580,8 +580,8 @@ bool net_ipv6addr_maskcmp(const net_ipv6addr_t addr1,
****************************************************************************/ ****************************************************************************/
#define net_is_addr_linklocal_allnodes_mcast(a) \ #define net_is_addr_linklocal_allnodes_mcast(a) \
((a)[0] == 0xff02 && (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ ((a)[0] == HTONS(0xff02) && (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && (a)[7] == 0x0001) (a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && (a)[7] == HTONS(0x0001))
/**************************************************************************** /****************************************************************************
* Name: net_is_addr_linklocal_allrouters_mcast * Name: net_is_addr_linklocal_allrouters_mcast
@@ -592,8 +592,8 @@ bool net_ipv6addr_maskcmp(const net_ipv6addr_t addr1,
****************************************************************************/ ****************************************************************************/
#define net_is_addr_linklocal_allrouters_mcast(a) \ #define net_is_addr_linklocal_allrouters_mcast(a) \
((a)[0] == 0xff02 && (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ ((a)[0] == HTONS(0xff02) && (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && (a)[7] == 0x0002) (a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && (a)[7] == HTOS(0x0002))
/**************************************************************************** /****************************************************************************
* Name: net_is_addr_linklocal * Name: net_is_addr_linklocal
@@ -603,7 +603,7 @@ bool net_ipv6addr_maskcmp(const net_ipv6addr_t addr1,
* *
****************************************************************************/ ****************************************************************************/
#define net_is_addr_linklocal(a) ((a)[0] == 0xfe80) #define net_is_addr_linklocal(a) ((a)[0] == HTONS(0xfe80))
/**************************************************************************** /****************************************************************************
* Name: net_ipaddr_mask * Name: net_ipaddr_mask
+53 -11
View File
@@ -58,6 +58,20 @@
#include "igmp/igmp.h" #include "igmp/igmp.h"
#include "sixlowpan/sixlowpan.h" #include "sixlowpan/sixlowpan.h"
/****************************************************************************
* Private Types
****************************************************************************/
enum devif_packet_type
{
DEVIF_PKT = 0,
DEVIF_ICMP,
DEVIF_IGMP,
DEVIF_TCP,
DEVIF_UDP,
DEVIF_ICMP6
};
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
@@ -74,6 +88,9 @@ systime_t g_polltime;
* Function: devif_packet_conversion * Function: devif_packet_conversion
* *
* Description: * Description:
* Generic output conversion hook. Only needed for IEEE802.15.4 for now
* is a point where support for other conversions may be provided.
*
* TCP output comes through three different mechansims. Either from: * TCP output comes through three different mechansims. Either from:
* *
* 1. TCP socket output. For the case of TCP output to an * 1. TCP socket output. For the case of TCP output to an
@@ -94,7 +111,8 @@ systime_t g_polltime;
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
static inline void devif_packet_conversion(FAR struct net_driver_s *dev) static void devif_packet_conversion(FAR struct net_driver_s *dev,
enum devif_packet_type pkttype)
{ {
#ifdef CONFIG_NET_MULTILINK #ifdef CONFIG_NET_MULTILINK
/* Handle the case where multiple link layer protocols are supported */ /* Handle the case where multiple link layer protocols are supported */
@@ -104,14 +122,38 @@ static inline void devif_packet_conversion(FAR struct net_driver_s *dev)
if (dev->d_len > 0) if (dev->d_len > 0)
#endif #endif
{ {
/* Let 6loWPAN convert output into the IEEE802.15.4 frames */ if (pkttype == DEVIF_TCP)
{
FAR struct ipv6_hdr_s *ipv6 = (FAR struct ipv6_hdr_s *)dev->d_buf;
/* This packet came from a response to TCP polling and is directed
* to an IEEE802.15.4 device using 6loWPAN. Verify that the outgoing
* packet is IPv6 with TCP protocol.
*/
if (ipv6->vtc == IPv6_VERSION && ipv6->proto == IP_PROTO_TCP)
{
/* Let 6loWPAN convert IPv6 TCP output into IEEE802.15.4 frames. */
sixlowpan_tcp_send(dev);
}
else
{
nerr("ERROR: IPv6 version or protocol error. Packet dropped\n");
nerr(" IP version: %02x proocol: %u\n",
ipv6->vtc, ipv6->proto);
}
}
else
{
nerr("ERROR: Non-TCP packet dropped. Packet type: %u\n", pkttype);
}
sixlowpan_tcp_send(dev);
dev->d_len = 0; dev->d_len = 0;
} }
} }
#else #else
# define devif_packet_conversion(dev) # define devif_packet_conversion(dev,pkttype)
#endif /* CONFIG_NET_6LOWPAN */ #endif /* CONFIG_NET_6LOWPAN */
/**************************************************************************** /****************************************************************************
@@ -143,7 +185,7 @@ static int devif_poll_pkt_connections(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_PKT);
/* Call back into the driver */ /* Call back into the driver */
@@ -172,7 +214,7 @@ static inline int devif_poll_icmp(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_ICMP);
/* Call back into the driver */ /* Call back into the driver */
@@ -198,7 +240,7 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_ICMP6);
/* Call back into the driver */ /* Call back into the driver */
@@ -228,7 +270,7 @@ static inline int devif_poll_igmp(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_IGMP);
/* Call back into the driver */ /* Call back into the driver */
@@ -265,7 +307,7 @@ static int devif_poll_udp_connections(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_UDP);
/* Call back into the driver */ /* Call back into the driver */
@@ -305,7 +347,7 @@ static inline int devif_poll_tcp_connections(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_TCP);
/* Call back into the driver */ /* Call back into the driver */
@@ -349,7 +391,7 @@ static inline int devif_poll_tcp_timer(FAR struct net_driver_s *dev,
/* Perform any necessary conversions on outgoing packets */ /* Perform any necessary conversions on outgoing packets */
devif_packet_conversion(dev); devif_packet_conversion(dev, DEVIF_TCP);
/* Call back into the driver */ /* Call back into the driver */
+49 -1
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* net/procfs/netdev_statistics.c * net/procfs/netdev_statistics.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <netinet/ether.h> #include <netinet/ether.h>
#include <nuttx/net/netdev.h> #include <nuttx/net/netdev.h>
#include <nuttx/net/sixlowpan.h>
#include "netdev/netdev.h" #include "netdev/netdev.h"
#include "utils/utils.h" #include "utils/utils.h"
@@ -106,6 +107,9 @@ static const linegen_t g_linegen[] =
static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile) static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)
{ {
FAR struct net_driver_s *dev; FAR struct net_driver_s *dev;
#ifdef CONFIG_NET_6LOWPAN
FAR struct ieee802154_driver_s *ieee;
#endif
FAR const char *status; FAR const char *status;
int len = 0; int len = 0;
@@ -142,6 +146,30 @@ static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)
break; break;
#endif #endif
#ifdef CONFIG_NET_6LOWPAN
case NET_LL_IEEE802154:
{
ieee = (FAR struct ieee802154_driver_s *)dev;
#if CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 2
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:6loWPAN HWaddr %02x:%02x",
dev->d_ifname,
ieee->i_nodeaddr.u8[0], ieee->i_nodeaddr.u8[1]);
#else /* CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 8 */
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:6loWPAN HWaddr "
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
dev->d_ifname,
ieee->i_nodeaddr.u8[0], ieee->i_nodeaddr.u8[1],
ieee->i_nodeaddr.u8[2], ieee->i_nodeaddr.u8[3],
ieee->i_nodeaddr.u8[4], ieee->i_nodeaddr.u8[5],
ieee->i_nodeaddr.u8[6], ieee->i_nodeaddr.u8[7]);
#endif
}
break;
#endif
#ifdef CONFIG_NET_LOOPBACK #ifdef CONFIG_NET_LOOPBACK
case NET_LL_LOOPBACK: case NET_LL_LOOPBACK:
len += snprintf(&netfile->line[len], NET_LINELEN - len, len += snprintf(&netfile->line[len], NET_LINELEN - len,
@@ -184,6 +212,26 @@ static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)
"%s\tLink encap:Ethernet HWaddr %s at %s\n", "%s\tLink encap:Ethernet HWaddr %s at %s\n",
dev->d_ifname, ether_ntoa(&dev->d_mac), status); dev->d_ifname, ether_ntoa(&dev->d_mac), status);
#elif defined(CONFIG_NET_6LOWPAN)
ieee = (FAR struct ieee802154_driver_s *)dev;
#if CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 2
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:6loWPAN HWaddr %02x:%02x at %s",
dev->d_ifname,
ieee->i_nodeaddr.u8[0], ieee->i_nodeaddr.u8[1],
status);
#else /* CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 8 */
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:6loWPAN HWaddr "
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x at %s",
dev->d_ifname,
ieee->i_nodeaddr.u8[0], ieee->i_nodeaddr.u8[1],
ieee->i_nodeaddr.u8[2], ieee->i_nodeaddr.u8[3],
ieee->i_nodeaddr.u8[4], ieee->i_nodeaddr.u8[5],
ieee->i_nodeaddr.u8[6], ieee->i_nodeaddr.u8[7],
status);
#endif
#elif defined(CONFIG_NET_LOOPBACK) #elif defined(CONFIG_NET_LOOPBACK)
len += snprintf(&netfile->line[len], NET_LINELEN - len, len += snprintf(&netfile->line[len], NET_LINELEN - len,
"%s\tLink encap:Local Loopback at %s\n", "%s\tLink encap:Local Loopback at %s\n",
+2 -1
View File
@@ -455,7 +455,8 @@ void sixlowpan_compresshdr_hc06(FAR struct ieee802154_driver_s *ieee,
uint8_t iphc1; uint8_t iphc1;
uint8_t tmp; uint8_t tmp;
ninfodumpbuffer("IPv6 before compression", ipv6, sizeof(struct ipv6_hdr_s)); ninfodumpbuffer("IPv6 before compression", (FAR const uint8_t *)ipv6,
sizeof(struct ipv6_hdr_s));
g_hc06ptr = g_rimeptr + 2; g_hc06ptr = g_rimeptr + 2;
+7 -6
View File
@@ -243,7 +243,8 @@
*/ */
#define SIXLOWPAN_IS_IID_16BIT_COMPRESSABLE(a) \ #define SIXLOWPAN_IS_IID_16BIT_COMPRESSABLE(a) \
((((a)[4]) == 0x0000) && (((a)[5]) == 0x00ff) && (((a)[6]) == 0xfe00)) ((((a)[4]) == 0x0000) && (((a)[5]) == HTONS(0x00ff)) && \
(((a)[6]) == 0xfe00))
/* Check whether the 9-bit group-id of the compressed multicast address is /* Check whether the 9-bit group-id of the compressed multicast address is
* known. It is true if the 9-bit group is the all nodes or all routers * known. It is true if the 9-bit group is the all nodes or all routers
@@ -265,27 +266,27 @@
#define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE(a) \ #define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE(a) \
((a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ ((a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && \ (a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && \
((a)[7] == 0x0001 || (a)[7] == 0x0002)) ((a)[7] == HTONS(0x0001) || (a)[7] == HTONS(0x0002)))
/* FFXX:0000:0000:0000:0000:00XX:XXXX:XXXX */ /* FFXX:0000:0000:0000:0000:00XX:XXXX:XXXX */
#define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE48(a) \ #define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE48(a) \
((a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ ((a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (((a)[5] & 0xff00) == 0)) (a)[4] == 0 && (((a)[5] & HTONS(0xff00)) == 0))
/* FFXX:0000:0000:0000:0000:0000:00XX:XXXX */ /* FFXX:0000:0000:0000:0000:0000:00XX:XXXX */
#define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE32(a) \ #define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE32(a) \
((a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ ((a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (a)[5] == 0 && ((a)[6] & 0xff00) == 0) (a)[4] == 0 && (a)[5] == 0 && ((a)[6] & HTONS(0xff00)) == 0)
/* FF02:0000:0000:0000:0000:0000:0000:00XX */ /* FF02:0000:0000:0000:0000:0000:0000:00XX */
#define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE8(a) \ #define SIXLOWPAN_IS_MCASTADDR_COMPRESSABLE8(a) \
((((a)[0] & 0x00ff) == 0x0002) && \ ((((a)[0] & HTONS(0x00ff)) == HTONS(0x0002)) && \
(a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \ (a)[1] == 0 && (a)[2] == 0 && (a)[3] == 0 && \
(a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && \ (a)[4] == 0 && (a)[5] == 0 && (a)[6] == 0 && \
(((a)[7] & 0xff00) == 0x0000)) (((a)[7] & HTONS(0xff00)) == 0x0000))
/* General helper macros ****************************************************/ /* General helper macros ****************************************************/
+2 -2
View File
@@ -393,10 +393,10 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev)
size_t hdrlen; size_t hdrlen;
hdrlen = IPv6_HDRLEN + TCP_HDRLEN; hdrlen = IPv6_HDRLEN + TCP_HDRLEN;
if (hdrlen < dev->d_len) if (hdrlen > dev->d_len)
{ {
nwarn("WARNING: Packet to small: Have %u need >%u\n", nwarn("WARNING: Packet to small: Have %u need >%u\n",
dev->d_len, hdrlen); dev->d_len, hdrlen);
} }
else else
{ {
+4 -4
View File
@@ -116,7 +116,7 @@ void sixlowpan_ipfromrime(FAR const struct rimeaddr_s *rime,
net_ipv6addr_t ipaddr) net_ipv6addr_t ipaddr)
{ {
memset(ipaddr, 0, sizeof(net_ipv6addr_t)); memset(ipaddr, 0, sizeof(net_ipv6addr_t));
ipaddr[0] = 0xfe80; ipaddr[0] = HTONS(0xfe80);
/* We consider only links with IEEE EUI-64 identifier or IEEE 48-bit MAC /* We consider only links with IEEE EUI-64 identifier or IEEE 48-bit MAC
* addresses. NOTE: that CONFIG_NET_6LOWPAN_RIMEADDR_SIZE may be 2 or * addresses. NOTE: that CONFIG_NET_6LOWPAN_RIMEADDR_SIZE may be 2 or
@@ -128,7 +128,7 @@ void sixlowpan_ipfromrime(FAR const struct rimeaddr_s *rime,
*/ */
memcpy(&ipaddr[4], rime, CONFIG_NET_6LOWPAN_RIMEADDR_SIZE); memcpy(&ipaddr[4], rime, CONFIG_NET_6LOWPAN_RIMEADDR_SIZE);
ipaddr[4] ^= 0x0200; ipaddr[4] ^= HTONS(0x0200);
} }
/**************************************************************************** /****************************************************************************
@@ -174,10 +174,10 @@ bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
FAR const uint8_t *rimeptr = rime->u8; FAR const uint8_t *rimeptr = rime->u8;
#if CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 2 #if CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 2
return ((ipaddr[4] == (GETINT16(rimeptr, 0) ^ 0x0200)) && return ((ipaddr[4] == htons((GETINT16(rimeptr, 0) ^ 0x0200))) &&
ipaddr[5] == 0 && ipaddr[6] == 0 && ipaddr[7] == 0); ipaddr[5] == 0 && ipaddr[6] == 0 && ipaddr[7] == 0);
#else /* CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 8 */ #else /* CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 8 */
return ((ipaddr[4] == (GETINT16(rimeptr, 0) ^ 0x0200)) && return ((ipaddr[4] == htons((GETINT16(rimeptr, 0) ^ 0x0200))) &&
ipaddr[5] == GETINT16(rimeptr, 2) && ipaddr[5] == GETINT16(rimeptr, 2) &&
ipaddr[6] == GETINT16(rimeptr, 4) && ipaddr[6] == GETINT16(rimeptr, 4) &&
ipaddr[7] == GETINT16(rimeptr, 6)); ipaddr[7] == GETINT16(rimeptr, 6));
-1
View File
@@ -250,7 +250,6 @@ int tcp_local_ipv6_device(FAR struct tcp_conn_s *conn)
#else #else
return tcp_find_ipv6_device(conn, NULL); return tcp_find_ipv6_device(conn, NULL);
#endif #endif
} }
#endif /* CONFIG_NET_IPv6 */ #endif /* CONFIG_NET_IPv6 */