Use RPL_DAG_LIFETIME when computing dag lifetime

This commit is contained in:
Laurent Deru 2016-06-13 11:36:17 +02:00
parent c1f11cfaa9
commit 0fb597f2fa
3 changed files with 9 additions and 9 deletions

View File

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

View File

@ -286,14 +286,14 @@
GENERATE_MSG(0000000, "add-sink-2");&#xD;
GENERATE_MSG(0000000, "remove-sink-3");&#xD;
&#xD;
GENERATE_MSG(2000000, "remove-sink-1");&#xD;
GENERATE_MSG(4000000, "remove-sink-2");&#xD;
GENERATE_MSG(4000000, "add-sink-3");&#xD;
GENERATE_MSG(6000000, "remove-sink-1");&#xD;
GENERATE_MSG(12000000, "remove-sink-2");&#xD;
GENERATE_MSG(12000000, "add-sink-3");&#xD;
&#xD;
lostMsgs = 0;&#xD;
newDagOk = 0;&#xD;
&#xD;
TIMEOUT(6000000, if(newDagOk == 2) { log.testOK(); } );&#xD;
TIMEOUT(18000000, if(newDagOk == 2) { log.testOK(); } );&#xD;
&#xD;
lastMsg = -1;&#xD;
newSink = 0;&#xD;

View File

@ -286,14 +286,14 @@
GENERATE_MSG(0000000, "add-sink-2");&#xD;
GENERATE_MSG(0000000, "remove-sink-3");&#xD;
&#xD;
GENERATE_MSG(2000000, "remove-sink-1");&#xD;
GENERATE_MSG(4000000, "remove-sink-2");&#xD;
GENERATE_MSG(4000000, "add-sink-3");&#xD;
GENERATE_MSG(6000000, "remove-sink-1");&#xD;
GENERATE_MSG(12000000, "remove-sink-2");&#xD;
GENERATE_MSG(12000000, "add-sink-3");&#xD;
&#xD;
lostMsgs = 0;&#xD;
newDagOk = 0;&#xD;
&#xD;
TIMEOUT(6000000, if(newDagOk == 2) { log.testOK(); } );&#xD;
TIMEOUT(18000000, if(newDagOk == 2) { log.testOK(); } );&#xD;
&#xD;
lastMsg = -1;&#xD;
newSink = 0;&#xD;