Merge pull request #2053 from cetic/pr-fix-dag-lifetime
Use RPL_DAG_LIFETIME when computing dag lifetime
This commit is contained in:
commit
0cfda4c026
|
@ -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);
|
||||||
|
|
|
@ -286,14 +286,14 @@
|
||||||
GENERATE_MSG(0000000, "add-sink-2");
|
GENERATE_MSG(0000000, "add-sink-2");
|
||||||
GENERATE_MSG(0000000, "remove-sink-3");
|
GENERATE_MSG(0000000, "remove-sink-3");
|
||||||

|

|
||||||
GENERATE_MSG(2000000, "remove-sink-1");
|
GENERATE_MSG(6000000, "remove-sink-1");
|
||||||
GENERATE_MSG(4000000, "remove-sink-2");
|
GENERATE_MSG(12000000, "remove-sink-2");
|
||||||
GENERATE_MSG(4000000, "add-sink-3");
|
GENERATE_MSG(12000000, "add-sink-3");
|
||||||

|

|
||||||
lostMsgs = 0;
|
lostMsgs = 0;
|
||||||
newDagOk = 0;
|
newDagOk = 0;
|
||||||

|

|
||||||
TIMEOUT(6000000, if(newDagOk == 2) { log.testOK(); } );
|
TIMEOUT(18000000, if(newDagOk == 2) { log.testOK(); } );
|
||||||

|

|
||||||
lastMsg = -1;
|
lastMsg = -1;
|
||||||
newSink = 0;
|
newSink = 0;
|
||||||
|
|
|
@ -286,14 +286,14 @@
|
||||||
GENERATE_MSG(0000000, "add-sink-2");
|
GENERATE_MSG(0000000, "add-sink-2");
|
||||||
GENERATE_MSG(0000000, "remove-sink-3");
|
GENERATE_MSG(0000000, "remove-sink-3");
|
||||||

|

|
||||||
GENERATE_MSG(2000000, "remove-sink-1");
|
GENERATE_MSG(6000000, "remove-sink-1");
|
||||||
GENERATE_MSG(4000000, "remove-sink-2");
|
GENERATE_MSG(12000000, "remove-sink-2");
|
||||||
GENERATE_MSG(4000000, "add-sink-3");
|
GENERATE_MSG(12000000, "add-sink-3");
|
||||||

|

|
||||||
lostMsgs = 0;
|
lostMsgs = 0;
|
||||||
newDagOk = 0;
|
newDagOk = 0;
|
||||||

|

|
||||||
TIMEOUT(6000000, if(newDagOk == 2) { log.testOK(); } );
|
TIMEOUT(18000000, if(newDagOk == 2) { log.testOK(); } );
|
||||||

|

|
||||||
lastMsg = -1;
|
lastMsg = -1;
|
||||||
newSink = 0;
|
newSink = 0;
|
||||||
|
|
Loading…
Reference in a new issue