Updated DAG version processing to occur even for infinite rank DIOs. This makes it possible for the RPL root to infer the DAG version number from a network that hasn't had a root for a while, and where the rank has increased to infinity.
This commit is contained in:
parent
db7cb567f5
commit
15deb37e64
1 changed files with 26 additions and 22 deletions
|
@ -1096,27 +1096,10 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dio->rank == INFINITE_RANK) {
|
|
||||||
PRINTF("RPL: Ignoring DIO from node with infinite rank: ");
|
|
||||||
PRINT6ADDR(from);
|
|
||||||
PRINTF("\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
instance = rpl_get_instance(dio->instance_id);
|
|
||||||
if(instance == NULL) {
|
|
||||||
PRINTF("RPL: New instance detected: Joining...\n");
|
|
||||||
rpl_join_instance(from, dio);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dag = get_dag(dio->instance_id, &dio->dag_id);
|
dag = get_dag(dio->instance_id, &dio->dag_id);
|
||||||
if(dag == NULL) {
|
instance = rpl_get_instance(dio->instance_id);
|
||||||
PRINTF("RPL: Adding new DAG to known instance.\n");
|
|
||||||
rpl_add_dag(from, dio);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(dag != NULL && instance != NULL) {
|
||||||
if(lollipop_greater_than(dio->version, dag->version)) {
|
if(lollipop_greater_than(dio->version, dag->version)) {
|
||||||
if(dag->rank == ROOT_RANK(instance)) {
|
if(dag->rank == ROOT_RANK(instance)) {
|
||||||
PRINTF("RPL: Root received inconsistent DIO version number\n");
|
PRINTF("RPL: Root received inconsistent DIO version number\n");
|
||||||
|
@ -1137,6 +1120,27 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dio->rank == INFINITE_RANK) {
|
||||||
|
PRINTF("RPL: Ignoring DIO from node with infinite rank: ");
|
||||||
|
PRINT6ADDR(from);
|
||||||
|
PRINTF("\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(instance == NULL) {
|
||||||
|
PRINTF("RPL: New instance detected: Joining...\n");
|
||||||
|
rpl_join_instance(from, dio);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dag == NULL) {
|
||||||
|
PRINTF("RPL: Adding new DAG to known instance.\n");
|
||||||
|
rpl_add_dag(from, dio);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(dio->rank < ROOT_RANK(instance)) {
|
if(dio->rank < ROOT_RANK(instance)) {
|
||||||
PRINTF("RPL: Ignoring DIO with too low rank: %u\n",
|
PRINTF("RPL: Ignoring DIO with too low rank: %u\n",
|
||||||
|
|
Loading…
Reference in a new issue