1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00

Merge pull request #2462 from BytesGalore/rpl_fix_hardfault_on_no_ocp

sys/net/routing/rpl: catch hardfault when OCP from DIO is not supported
This commit is contained in:
Cenk Gündoğan 2015-02-21 13:32:01 +01:00
commit fbf3296ca5
2 changed files with 12 additions and 0 deletions

View File

@ -483,6 +483,12 @@ void rpl_recv_DIO_mode(void)
dio_dodag.default_lifetime = rpl_opt_dodag_conf_buf->default_lifetime;
dio_dodag.lifetime_unit = byteorder_ntohs(rpl_opt_dodag_conf_buf->lifetime_unit);
dio_dodag.of = (struct rpl_of_t *) rpl_get_of_for_ocp(byteorder_ntohs(rpl_opt_dodag_conf_buf->ocp));
if (dio_dodag.of == NULL) {
DEBUGF("[Error] OCP from DIO is not supported! ocp: %x\n",
byteorder_ntohs(rpl_opt_dodag_conf_buf->ocp));
return;
}
len += RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN;
break;
}

View File

@ -514,6 +514,12 @@ void rpl_recv_DIO_mode(void)
dio_dodag.default_lifetime = rpl_opt_dodag_conf_buf->default_lifetime;
dio_dodag.lifetime_unit = byteorder_ntohs(rpl_opt_dodag_conf_buf->lifetime_unit);
dio_dodag.of = (struct rpl_of_t *) rpl_get_of_for_ocp(byteorder_ntohs(rpl_opt_dodag_conf_buf->ocp));
if (dio_dodag.of == NULL) {
DEBUGF("[Error] OCP from DIO is not supported! ocp: %x\n",
byteorder_ntohs(rpl_opt_dodag_conf_buf->ocp));
return;
}
len += RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN;
break;
}