Loop detection via DAO: if we get a DAO from a parent, that parent thinks we are its parent. We poison it and recalulate our parents.

This commit is contained in:
Adam Dunkels 2013-08-12 00:11:09 +02:00 committed by Simon Duquennoy
parent 34119b7ef2
commit e5a6565137

View File

@ -698,6 +698,14 @@ dao_input(void)
p->updated = 1;
return;
}
/* If we get the DAO from our parent, we also have a loop. */
if(p != NULL && p == dag->preferred_parent) {
PRINTF("RPL: Loop detected when receiving a unicast DAO from our parent\n");
p->rank = INFINITE_RANK;
p->updated = 1;
return;
}
}
PRINTF("RPL: adding DAO route\n");