1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

rpl: introduce constants for PREFIX_INFO length with/without RPL_OPT_LEN

This commit is contained in:
Cenk Gündoğan 2015-01-31 12:58:00 +01:00
parent 26095013a1
commit c14217c68e
3 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}