net: rpl: Fix router when it's timer expires

When router or default router timer expired, interface will remove
router from the list. In this case RPL does not know about this.
When RPL node receives DIO messages it only verifies whether parent
exists or not. This extra checks will verify whether router really
in "used" state or not.

Jira: ZEP-2080

Change-Id: I4b36b3a2d495e76a38caddd058451daff08fab0c
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2017-04-27 13:37:38 +03:00 committed by Jukka Rissanen
commit 5edf55f771

View file

@ -2625,6 +2625,18 @@ static void net_rpl_process_dio(struct net_if *iface,
}
}
if (instance->default_route && !instance->default_route->is_used) {
/* Maybe router timer expired or removed and RPL doesn't
* know about it. Verify router is in "used" state or not.
*/
instance->default_route = net_if_ipv6_router_add(iface, from,
net_rpl_lifetime(instance,
instance->default_lifetime));
if (!instance->default_route) {
return;
}
}
if (dag->rank == NET_RPL_ROOT_RANK(instance)) {
if (dio->rank != NET_RPL_INFINITE_RANK) {
instance->dio_counter++;