fixed bug where context is null but still referenced
This commit is contained in:
parent
494d2a3073
commit
77c5187a2e
|
@ -32,7 +32,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: sicslowpan.c,v 1.44 2010/06/06 12:44:12 joxe Exp $
|
* $Id: sicslowpan.c,v 1.45 2010/09/23 19:57:50 joxe Exp $
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* \file
|
* \file
|
||||||
|
@ -777,19 +777,17 @@ uncompress_hdr_hc06(u16_t ip_len) {
|
||||||
uint8_t sci = (iphc1 & SICSLOWPAN_IPHC_CID) ?
|
uint8_t sci = (iphc1 & SICSLOWPAN_IPHC_CID) ?
|
||||||
RIME_IPHC_BUF[2] >> 4 : 0;
|
RIME_IPHC_BUF[2] >> 4 : 0;
|
||||||
|
|
||||||
/* Source address */
|
/* Source address - check context != NULL only if SAM bits are != 0*/
|
||||||
if((iphc1 & SICSLOWPAN_IPHC_SAM_11) != SICSLOWPAN_IPHC_SAM_00) {
|
if (tmp != 0) {
|
||||||
context =
|
context = addr_context_lookup_by_number(sci);
|
||||||
addr_context_lookup_by_number(sci);
|
|
||||||
if(context == NULL) {
|
if(context == NULL) {
|
||||||
PRINTF("sicslowpan uncompress_hdr: error context not found\n");
|
PRINTF("sicslowpan uncompress_hdr: error context not found\n");
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
PRINTF("IPHC: found compressed source context for sci = %d\n", sci);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uncompress_addr(&SICSLOWPAN_IP_BUF->srcipaddr, context->prefix,
|
/* if tmp == 0 we do not have a context and therefore no prefix */
|
||||||
unc_ctxconf[tmp],
|
uncompress_addr(&SICSLOWPAN_IP_BUF->srcipaddr,
|
||||||
|
tmp != 0 ? context->prefix : NULL, unc_ctxconf[tmp],
|
||||||
(uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_SENDER));
|
(uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_SENDER));
|
||||||
} else {
|
} else {
|
||||||
/* no compression and link local */
|
/* no compression and link local */
|
||||||
|
|
Loading…
Reference in a new issue