gnrc_sixlowpan_iphc: assure ctx != NULL for dst compression
For the source address compression it was already done the same way in 12bcc46f158945fb9684cbf309c80ed1655b0f3b
This commit is contained in:
parent
2cb0ccc800
commit
3ee75c3ca9
@ -454,6 +454,7 @@ void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *sixlo, void *rbuf_ptr,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IPHC_M_DAC_DAM_U_CTX_64:
|
case IPHC_M_DAC_DAM_U_CTX_64:
|
||||||
|
assert(ctx != NULL);
|
||||||
memcpy(ipv6_hdr->dst.u8 + 8, iphc_hdr + payload_offset, 8);
|
memcpy(ipv6_hdr->dst.u8 + 8, iphc_hdr + payload_offset, 8);
|
||||||
ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
|
ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
|
||||||
ctx->prefix_len);
|
ctx->prefix_len);
|
||||||
@ -464,6 +465,7 @@ void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *sixlo, void *rbuf_ptr,
|
|||||||
ipv6_hdr->dst.u32[2] = byteorder_htonl(0x000000ff);
|
ipv6_hdr->dst.u32[2] = byteorder_htonl(0x000000ff);
|
||||||
ipv6_hdr->dst.u16[6] = byteorder_htons(0xfe00);
|
ipv6_hdr->dst.u16[6] = byteorder_htons(0xfe00);
|
||||||
memcpy(ipv6_hdr->dst.u8 + 14, iphc_hdr + payload_offset, 2);
|
memcpy(ipv6_hdr->dst.u8 + 14, iphc_hdr + payload_offset, 2);
|
||||||
|
assert(ctx != NULL);
|
||||||
ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
|
ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
|
||||||
ctx->prefix_len);
|
ctx->prefix_len);
|
||||||
payload_offset += 2;
|
payload_offset += 2;
|
||||||
@ -477,6 +479,7 @@ void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *sixlo, void *rbuf_ptr,
|
|||||||
_recv_error_release(sixlo, ipv6, rbuf);
|
_recv_error_release(sixlo, ipv6, rbuf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
assert(ctx != NULL);
|
||||||
ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
|
ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
|
||||||
ctx->prefix_len);
|
ctx->prefix_len);
|
||||||
break;
|
break;
|
||||||
@ -509,6 +512,7 @@ void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *sixlo, void *rbuf_ptr,
|
|||||||
|
|
||||||
case IPHC_M_DAC_DAM_M_UC_PREFIX:
|
case IPHC_M_DAC_DAM_M_UC_PREFIX:
|
||||||
do {
|
do {
|
||||||
|
assert(ctx != NULL);
|
||||||
uint8_t orig_ctx_len = ctx->prefix_len;
|
uint8_t orig_ctx_len = ctx->prefix_len;
|
||||||
|
|
||||||
ipv6_addr_set_unspecified(&ipv6_hdr->dst);
|
ipv6_addr_set_unspecified(&ipv6_hdr->dst);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user