mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
6loWPAN: Correct more address manipulations.
This commit is contained in:
@@ -892,7 +892,7 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_4=0x0000
|
|||||||
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_5=0x0000
|
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_5=0x0000
|
||||||
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_6=0x00ff
|
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_6=0x00ff
|
||||||
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_7=0xfe00
|
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_7=0xfe00
|
||||||
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_8=0x3234
|
CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_8=0x1034
|
||||||
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
|
||||||
@@ -1100,7 +1100,7 @@ CONFIG_NSH_IPv6ADDR_4=0x0000
|
|||||||
CONFIG_NSH_IPv6ADDR_5=0x0000
|
CONFIG_NSH_IPv6ADDR_5=0x0000
|
||||||
CONFIG_NSH_IPv6ADDR_6=0x00ff
|
CONFIG_NSH_IPv6ADDR_6=0x00ff
|
||||||
CONFIG_NSH_IPv6ADDR_7=0xfe00
|
CONFIG_NSH_IPv6ADDR_7=0xfe00
|
||||||
CONFIG_NSH_IPv6ADDR_8=0x8bcd
|
CONFIG_NSH_IPv6ADDR_8=0xa9cd
|
||||||
|
|
||||||
#
|
#
|
||||||
# Router IPv6 address
|
# Router IPv6 address
|
||||||
@@ -1112,7 +1112,7 @@ CONFIG_NSH_DRIPv6ADDR_4=0x0000
|
|||||||
CONFIG_NSH_DRIPv6ADDR_5=0x0000
|
CONFIG_NSH_DRIPv6ADDR_5=0x0000
|
||||||
CONFIG_NSH_DRIPv6ADDR_6=0x00ff
|
CONFIG_NSH_DRIPv6ADDR_6=0x00ff
|
||||||
CONFIG_NSH_DRIPv6ADDR_7=0xfe00
|
CONFIG_NSH_DRIPv6ADDR_7=0xfe00
|
||||||
CONFIG_NSH_DRIPv6ADDR_8=0x3234
|
CONFIG_NSH_DRIPv6ADDR_8=0x1034
|
||||||
|
|
||||||
#
|
#
|
||||||
# IPv6 Network mask
|
# IPv6 Network mask
|
||||||
|
|||||||
@@ -73,8 +73,8 @@
|
|||||||
*
|
*
|
||||||
* 128 112 96 80 64 48 32 16
|
* 128 112 96 80 64 48 32 16
|
||||||
* ---- ---- ---- ---- ---- ---- ---- ----
|
* ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte Rime address
|
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte Rime address IEEE 48-bit MAC
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte Rime address
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte Rime address IEEE EUI-64
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -107,8 +107,8 @@ void sixlowpan_ipfromrime(FAR const struct rimeaddr_s *rime,
|
|||||||
*
|
*
|
||||||
* 128 112 96 80 64 48 32 16
|
* 128 112 96 80 64 48 32 16
|
||||||
* ---- ---- ---- ---- ---- ---- ---- ----
|
* ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte Rime address
|
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte Rime address IEEE 48-bit MAC
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte Rime address
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte Rime address IEEE EUI-64
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -135,8 +135,8 @@ void sixlowpan_rimefromip(const net_ipv6addr_t ipaddr,
|
|||||||
*
|
*
|
||||||
* 128 112 96 80 64 48 32 16
|
* 128 112 96 80 64 48 32 16
|
||||||
* ---- ---- ---- ---- ---- ---- ---- ----
|
* ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte Rime address
|
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte Rime address IEEE 48-bit MAC
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte Rime address
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte Rime address IEEE EUI-64
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -146,13 +146,13 @@ 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] == htons((GETINT16(rimeptr, 0) ^ 0x0200))) &&
|
return (ipaddr[5] == HTONS(0x00ff) && ipaddr[6] == HTONS(0xfe00) &&
|
||||||
ipaddr[5] == 0 && ipaddr[6] == 0 && ipaddr[7] == 0);
|
ipaddr[7] == htons((GETINT16(rimeptr, 0) ^ 0x0200)));
|
||||||
#else /* CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 8 */
|
#else /* CONFIG_NET_6LOWPAN_RIMEADDR_SIZE == 8 */
|
||||||
return ((ipaddr[4] == htons((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));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user