From e5a6565137fb868b85293085345847217f4145a0 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Mon, 12 Aug 2013 00:11:09 +0200 Subject: [PATCH] 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. --- core/net/rpl/rpl-icmp6.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/net/rpl/rpl-icmp6.c b/core/net/rpl/rpl-icmp6.c index 362d1a2d8..06f727e3a 100644 --- a/core/net/rpl/rpl-icmp6.c +++ b/core/net/rpl/rpl-icmp6.c @@ -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");