Merge pull request #2053 from cetic/pr-fix-dag-lifetime

Use RPL_DAG_LIFETIME when computing dag lifetime
This commit is contained in:
Nicolas Tsiftes 2017-01-20 11:08:43 +01:00 committed by GitHub
commit 0cfda4c026
3 changed files with 9 additions and 9 deletions

View file

@ -1545,7 +1545,7 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
} }
/* The DIO comes from a valid DAG, we can refresh its lifetime */ /* 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 "); PRINTF("Set dag ");
PRINT6ADDR(&dag->dag_id); PRINT6ADDR(&dag->dag_id);
PRINTF(" lifetime to %ld\n", dag->lifetime); PRINTF(" lifetime to %ld\n", dag->lifetime);

View file

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

View file

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