From afbb82030e37c91c8ffacbd0c3f69cbc6da17a10 Mon Sep 17 00:00:00 2001 From: Nicolas Tsiftes Date: Thu, 27 Mar 2014 16:00:32 +0100 Subject: [PATCH] Ensure that the objective function's reset function is called at least once. This will enable the objective function to initialize itself during run-time. --- core/net/rpl/rpl.c | 2 ++ core/net/rpl/rpl.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/core/net/rpl/rpl.c b/core/net/rpl/rpl.c index 9fca4c28e..c1384b0b6 100644 --- a/core/net/rpl/rpl.c +++ b/core/net/rpl/rpl.c @@ -308,6 +308,8 @@ rpl_init(void) #if RPL_CONF_STATS memset(&rpl_stats, 0, sizeof(rpl_stats)); #endif + + RPL_OF.reset(NULL); } /*---------------------------------------------------------------------------*/ #endif /* UIP_CONF_IPV6 */ diff --git a/core/net/rpl/rpl.h b/core/net/rpl/rpl.h index 562961d84..76134e44e 100644 --- a/core/net/rpl/rpl.h +++ b/core/net/rpl/rpl.h @@ -189,6 +189,9 @@ struct rpl_of { rpl_ocp_t ocp; }; typedef struct rpl_of rpl_of_t; + +/* Declare the selected objective function. */ +extern rpl_of_t RPL_OF; /*---------------------------------------------------------------------------*/ /* Instance */ struct rpl_instance {