diff --git a/sys/net/include/rpl/rpl_config.h b/sys/net/include/rpl/rpl_config.h index e55eda0b31..9720b14116 100644 --- a/sys/net/include/rpl/rpl_config.h +++ b/sys/net/include/rpl/rpl_config.h @@ -48,18 +48,20 @@ enum RPL_MSG_CODE { }; /* packet base lengths */ -#define DIO_BASE_LEN 24 -#define DIS_BASE_LEN 2 -#define DAO_BASE_LEN 4 -#define DAO_D_LEN 24 -#define DAO_ACK_LEN 4 -#define DAO_ACK_D_LEN 24 -#define RPL_OPT_LEN 2 -#define RPL_OPT_DODAG_CONF_LEN 16 -#define RPL_OPT_PREFIX_INFO_LEN 32 -#define RPL_OPT_SOLICITED_INFO_LEN 21 -#define RPL_OPT_TARGET_LEN 20 -#define RPL_OPT_TRANSIT_LEN 22 +#define DIO_BASE_LEN 24 +#define DIS_BASE_LEN 2 +#define DAO_BASE_LEN 4 +#define DAO_D_LEN 24 +#define DAO_ACK_LEN 4 +#define DAO_ACK_D_LEN 24 +#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 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 /* message options */ #define RPL_OPT_PAD1 0 diff --git a/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c b/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c index 503334de72..91e1adc52c 100644 --- a/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c +++ b/sys/net/routing/rpl/rpl_nonstoring/rpl_nonstoring.c @@ -276,7 +276,7 @@ void rpl_send_DIO_mode(ipv6_addr_t *destination) rpl_send_opt_dodag_conf_buf->default_lifetime = mydodag->default_lifetime; rpl_send_opt_dodag_conf_buf->lifetime_unit = mydodag->lifetime_unit; - opt_hdr_len += RPL_OPT_DODAG_CONF_LEN; + opt_hdr_len += RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN; uint16_t plen = ICMPV6_HDR_LEN + DIO_BASE_LEN + opt_hdr_len; @@ -483,7 +483,7 @@ void rpl_recv_DIO_mode(void) dio_dodag.default_lifetime = rpl_opt_dodag_conf_buf->default_lifetime; dio_dodag.lifetime_unit = rpl_opt_dodag_conf_buf->lifetime_unit; dio_dodag.of = (struct rpl_of_t *) rpl_get_of_for_ocp(rpl_opt_dodag_conf_buf->ocp); - len += RPL_OPT_DODAG_CONF_LEN; + len += RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN; break; } @@ -493,7 +493,7 @@ void rpl_recv_DIO_mode(void) 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 2afc8f5f1c..adc053c895 100644 --- a/sys/net/routing/rpl/rpl_storing/rpl_storing.c +++ b/sys/net/routing/rpl/rpl_storing/rpl_storing.c @@ -274,7 +274,7 @@ void rpl_send_DIO_mode(ipv6_addr_t *destination) rpl_send_opt_dodag_conf_buf->default_lifetime = mydodag->default_lifetime; rpl_send_opt_dodag_conf_buf->lifetime_unit = mydodag->lifetime_unit; - opt_hdr_len += RPL_OPT_DODAG_CONF_LEN; + opt_hdr_len += RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN; uint16_t plen = ICMPV6_HDR_LEN + DIO_BASE_LEN + opt_hdr_len; rpl_send(destination, (uint8_t *)icmp_send_buf, plen, IPV6_PROTO_NUM_ICMPV6); @@ -514,7 +514,7 @@ void rpl_recv_DIO_mode(void) dio_dodag.default_lifetime = rpl_opt_dodag_conf_buf->default_lifetime; dio_dodag.lifetime_unit = rpl_opt_dodag_conf_buf->lifetime_unit; dio_dodag.of = (struct rpl_of_t *) rpl_get_of_for_ocp(rpl_opt_dodag_conf_buf->ocp); - len += RPL_OPT_DODAG_CONF_LEN; + len += RPL_OPT_DODAG_CONF_LEN_WITH_OPT_LEN; break; } @@ -524,7 +524,7 @@ void rpl_recv_DIO_mode(void) return; } - len += RPL_OPT_PREFIX_INFO_LEN; + len += RPL_OPT_PREFIX_INFO_LEN_WITH_OPT_LEN; break; }