6loWPAN: Yet another fix related to buffer offsets primarily.

This commit is contained in:
Gregory Nutt 2017-04-04 14:27:21 -06:00
parent fdf706a3a9
commit 34da085b40
2 changed files with 6 additions and 6 deletions

View File

@ -115,14 +115,14 @@ static void sixlowpan_compress_ipv6hdr(FAR struct ieee802154_driver_s *ieee,
{
/* Indicate the IPv6 dispatch and length */
*fptr = SIXLOWPAN_DISPATCH_IPV6;
g_frame_hdrlen += SIXLOWPAN_IPV6_HDR_LEN;
fptr[g_frame_hdrlen] = SIXLOWPAN_DISPATCH_IPV6;
g_frame_hdrlen += SIXLOWPAN_IPV6_HDR_LEN;
/* Copy the IPv6 header and adjust pointers */
memcpy(fptr + g_frame_hdrlen, destip, IPv6_HDRLEN);
g_frame_hdrlen += IPv6_HDRLEN;
g_uncomp_hdrlen += IPv6_HDRLEN;
memcpy(&fptr[g_frame_hdrlen] , destip, IPv6_HDRLEN);
g_frame_hdrlen += IPv6_HDRLEN;
g_uncomp_hdrlen += IPv6_HDRLEN;
}
/****************************************************************************

View File

@ -440,7 +440,7 @@ static int sixlowpan_frame_process(FAR struct ieee802154_driver_s *ieee,
hc1 = payptr + g_frame_hdrlen;
#ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06
#ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06
if ((hc1[RIME_HC1_DISPATCH] & SIXLOWPAN_DISPATCH_IPHC_MASK) == SIXLOWPAN_DISPATCH_IPHC)
{
ninfo("IPHC Dispatch\n");