rpl_verify_header: sanity-check 'sender' before updating rank

This commit is contained in:
Simon Duquennoy 2015-11-16 11:15:36 +01:00
parent 66ec94fd74
commit 79c436ac03

View File

@ -135,7 +135,7 @@ rpl_verify_header(int uip_ext_opt_offset)
sender = nbr_table_get_from_lladdr(rpl_parents, packetbuf_addr(PACKETBUF_ADDR_SENDER));
if(UIP_EXT_HDR_OPT_RPL_BUF->flags & RPL_HDR_OPT_RANK_ERR) {
if(sender != NULL && (UIP_EXT_HDR_OPT_RPL_BUF->flags & RPL_HDR_OPT_RANK_ERR)) {
/* A rank error was signalled, attempt to repair it by updating
* the sender's rank from ext header */
sender->rank = sender_rank;