6LoWPAN: Fix a typo in an index that prevented use with HC1 and extended addresses.

This commit is contained in:
Gregory Nutt
2017-06-23 10:08:03 -06:00
parent 1a46ea644d
commit 328a464f99
5 changed files with 10 additions and 8 deletions
+6 -4
View File
@@ -296,11 +296,13 @@ int sixlowpan_uncompresshdr_hc1(FAR const struct ieee802154_data_ind_s *ind,
ninfo("fptr=%p g_frame_hdrlen=%u\n", fptr, g_frame_hdrlen);
/* Format the IPv6 header in the device d_buf */
/* Set version, traffic clase, and flow label */
/* Set version, traffic clase, and flow label. This assumes that Bit 4 is
* set in HC1.
*/
ipv6->vtc = 0x60; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
ipv6->tcf = 0; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */
ipv6->flow = 0; /* 16-bit flow label (LS) */
ipv6->vtc = 0x60; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
ipv6->tcf = 0; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */
ipv6->flow = 0; /* 16-bit flow label (LS) */
g_uncomp_hdrlen += IPv6_HDRLEN;
+1 -1
View File
@@ -170,7 +170,7 @@ void sixlowpan_ipfromeaddr(FAR const uint8_t *eaddr,
ipaddr[4] = (uint16_t)eaddr[0] << 8 | (uint16_t)eaddr[1];
ipaddr[5] = (uint16_t)eaddr[2] << 8 | (uint16_t)eaddr[3];
ipaddr[6] = (uint16_t)eaddr[4] << 8 | (uint16_t)eaddr[5];
ipaddr[7] = (uint16_t)eaddr[6] << 8 | (uint16_t)eaddr[6];
ipaddr[7] = (uint16_t)eaddr[6] << 8 | (uint16_t)eaddr[7];
ipaddr[4] ^= 0x200;
}