Skip to content

Commit

Permalink
sys/net/routing/rpl: catch hardfault when OCP from DIO is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
BytesGalore authored and BytesGalore committed Feb 19, 2015
1 parent 41575f3 commit 9e0ccc3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions sys/net/routing/rpl/rpl_storing/rpl_storing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9e0ccc3

Please sign in to comment.