mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
6LoWPAN: Fix a typo in an index that prevented use with HC1 and extended addresses.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user