From 3cb82e7d6c521fda0a9e4a2e01724f3cce139f97 Mon Sep 17 00:00:00 2001 From: tdesmet Date: Tue, 14 Aug 2018 21:23:11 +0200 Subject: [PATCH 1/2] Add option to validate dio before init dag --- os/net/routing/rpl-lite/rpl-conf.h | 7 +++++++ os/net/routing/rpl-lite/rpl-dag.c | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/os/net/routing/rpl-lite/rpl-conf.h b/os/net/routing/rpl-lite/rpl-conf.h index 8d2f4b7b9..9b8a12adb 100644 --- a/os/net/routing/rpl-lite/rpl-conf.h +++ b/os/net/routing/rpl-lite/rpl-conf.h @@ -191,6 +191,13 @@ #define RPL_DEFAULT_LEAF_ONLY 0 #endif +/* + * Function used to validate dio before using it to init dag + */ +#ifdef RPL_CONF_VALIDATE_DIO_FUNC +#define RPL_VALIDATE_DIO_FUNC RPL_CONF_VALIDATE_DIO_FUNC +#endif + /******************************************************************************/ /********************************** Timing ************************************/ /******************************************************************************/ diff --git a/os/net/routing/rpl-lite/rpl-dag.c b/os/net/routing/rpl-lite/rpl-dag.c index 68d9e7aaa..09caa9625 100644 --- a/os/net/routing/rpl-lite/rpl-dag.c +++ b/os/net/routing/rpl-lite/rpl-dag.c @@ -61,6 +61,12 @@ static int init_dag_from_dio(rpl_dio_t *dio); /* Allocate instance table. */ rpl_instance_t curr_instance; +/*---------------------------------------------------------------------------*/ + +#ifdef RPL_VALIDATE_DIO_FUNC +int RPL_VALIDATE_DIO_FUNC(rpl_dio_t *dio); +#endif /* RPL_PROBING_SELECT_FUNC */ + /*---------------------------------------------------------------------------*/ const char * rpl_dag_state_to_str(enum rpl_dag_state state) @@ -542,6 +548,13 @@ init_dag_from_dio(rpl_dio_t *dio) static int process_dio_init_dag(uip_ipaddr_t *from, rpl_dio_t *dio) { +#ifdef RPL_VALIDATE_DIO_FUNC + if(!RPL_VALIDATE_DIO_FUNC(dio)) { + LOG_WARN("DIO validation failed\n"); + return 0; + } +#endif + /* Check MOP */ if(dio->mop != RPL_MOP_NO_DOWNWARD_ROUTES && dio->mop != RPL_MOP_NON_STORING) { LOG_WARN("ignoring DIO with an unsupported MOP: %d\n", dio->mop); From cbba3750b64e67cdd4bf95916b4437d2a21f74ef Mon Sep 17 00:00:00 2001 From: Tom De Smet Date: Fri, 31 Aug 2018 08:50:45 +0200 Subject: [PATCH 2/2] Bump tinydtls to latest commit --- os/net/security/tinydtls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/net/security/tinydtls b/os/net/security/tinydtls index 5da931eeb..53a0d97da 160000 --- a/os/net/security/tinydtls +++ b/os/net/security/tinydtls @@ -1 +1 @@ -Subproject commit 5da931eeb78d1cd4a1e0068a91de9b78bd3f66de +Subproject commit 53a0d97da748a67093c49cb38744650c71d58c4d