From 0fb597f2fa5eacbf09c415c2d39daf9ccefe0924 Mon Sep 17 00:00:00 2001 From: Laurent Deru Date: Mon, 13 Jun 2016 11:36:17 +0200 Subject: [PATCH] Use RPL_DAG_LIFETIME when computing dag lifetime --- core/net/rpl/rpl-dag.c | 2 +- regression-tests/12-rpl/10-rpl-multi-dodag.csc | 8 ++++---- .../23-rpl-non-storing/10-rpl-multi-dodag.csc | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index 1eb6775c1..0dc61881b 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -1542,7 +1542,7 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) } /* The DIO comes from a valid DAG, we can refresh its lifetime */ - dag->lifetime = (1UL << (instance->dio_intmin + instance->dio_intdoubl)) / 1000; + dag->lifetime = (1UL << (instance->dio_intmin + instance->dio_intdoubl)) * RPL_DAG_LIFETIME / 1000; PRINTF("Set dag "); PRINT6ADDR(&dag->dag_id); PRINTF(" lifetime to %ld\n", dag->lifetime); diff --git a/regression-tests/12-rpl/10-rpl-multi-dodag.csc b/regression-tests/12-rpl/10-rpl-multi-dodag.csc index 0f446cc65..375683a89 100644 --- a/regression-tests/12-rpl/10-rpl-multi-dodag.csc +++ b/regression-tests/12-rpl/10-rpl-multi-dodag.csc @@ -286,14 +286,14 @@ GENERATE_MSG(0000000, "add-sink-2"); GENERATE_MSG(0000000, "remove-sink-3"); -GENERATE_MSG(2000000, "remove-sink-1"); -GENERATE_MSG(4000000, "remove-sink-2"); -GENERATE_MSG(4000000, "add-sink-3"); +GENERATE_MSG(6000000, "remove-sink-1"); +GENERATE_MSG(12000000, "remove-sink-2"); +GENERATE_MSG(12000000, "add-sink-3"); lostMsgs = 0; newDagOk = 0; -TIMEOUT(6000000, if(newDagOk == 2) { log.testOK(); } ); +TIMEOUT(18000000, if(newDagOk == 2) { log.testOK(); } ); lastMsg = -1; newSink = 0; diff --git a/regression-tests/23-rpl-non-storing/10-rpl-multi-dodag.csc b/regression-tests/23-rpl-non-storing/10-rpl-multi-dodag.csc index 0f446cc65..375683a89 100644 --- a/regression-tests/23-rpl-non-storing/10-rpl-multi-dodag.csc +++ b/regression-tests/23-rpl-non-storing/10-rpl-multi-dodag.csc @@ -286,14 +286,14 @@ GENERATE_MSG(0000000, "add-sink-2"); GENERATE_MSG(0000000, "remove-sink-3"); -GENERATE_MSG(2000000, "remove-sink-1"); -GENERATE_MSG(4000000, "remove-sink-2"); -GENERATE_MSG(4000000, "add-sink-3"); +GENERATE_MSG(6000000, "remove-sink-1"); +GENERATE_MSG(12000000, "remove-sink-2"); +GENERATE_MSG(12000000, "add-sink-3"); lostMsgs = 0; newDagOk = 0; -TIMEOUT(6000000, if(newDagOk == 2) { log.testOK(); } ); +TIMEOUT(18000000, if(newDagOk == 2) { log.testOK(); } ); lastMsg = -1; newSink = 0;