diff --git a/sys/net/include/rpl/rpl_config.h b/sys/net/include/rpl/rpl_config.h index c725f75c85..9720b14116 100644 --- a/sys/net/include/rpl/rpl_config.h +++ b/sys/net/include/rpl/rpl_config.h @@ -57,7 +57,8 @@ enum RPL_MSG_CODE { #define RPL_OPT_LEN 2 #define RPL_OPT_DODAG_CONF_LEN 14 #define RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN (RPL_OPT_DODAG_CONF_LEN + RPL_OPT_LEN) -#define RPL_OPT_PREFIX_INFO_LEN 32 +#define RPL_OPT_PREFIX_INFO_LEN 30 +#define RPL_OPT_PREFIX_INFO_LEN_WITH_OPT_LEN (RPL_OPT_PREFIX_INFO_LEN + RPL_OPT_LEN) #define RPL_OPT_SOLICITED_INFO_LEN 21 #define RPL_OPT_TARGET_LEN 20 #define RPL_OPT_TRANSIT_LEN 22 diff --git a/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c b/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c index e2d5e19222..91e1adc52c 100644 --- a/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c +++ b/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c @@ -488,12 +488,12 @@ void rpl_recv_DIO_mode(void) } case (RPL_OPT_PREFIX_INFO): { - if (rpl_opt_buf->length != (RPL_OPT_PREFIX_INFO_LEN - RPL_OPT_LEN)) { + if (rpl_opt_buf->length != RPL_OPT_PREFIX_INFO_LEN) { /* error malformed */ return; } - len += RPL_OPT_PREFIX_INFO_LEN; + len += RPL_OPT_PREFIX_INFO_LEN_WITH_OPT_LEN; break; } diff --git a/sys/net/routing/rpl/rpl_storing/rpl_storing.c b/sys/net/routing/rpl/rpl_storing/rpl_storing.c index d06cb506e8..adc053c895 100644 --- a/sys/net/routing/rpl/rpl_storing/rpl_storing.c +++ b/sys/net/routing/rpl/rpl_storing/rpl_storing.c @@ -519,12 +519,12 @@ void rpl_recv_DIO_mode(void) } case (RPL_OPT_PREFIX_INFO): { - if (rpl_opt_buf->length != (RPL_OPT_PREFIX_INFO_LEN - RPL_OPT_LEN)) { + if (rpl_opt_buf->length != RPL_OPT_PREFIX_INFO_LEN) { /* error malformed */ return; } - len += RPL_OPT_PREFIX_INFO_LEN; + len += RPL_OPT_PREFIX_INFO_LEN_WITH_OPT_LEN; break; }