TSCH-RPL: reset link statistics when leaving network

This commit is contained in:
Simon Duquennoy 2018-03-25 06:31:23 -07:00
parent c6a5819d8d
commit 146427724a
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,7 @@
#include "net/mac/tsch/tsch-schedule.h"
#include "net/mac/tsch/tsch-log.h"
#include "net/mac/tsch/tsch-rpl.h"
#include "net/link-stats.h"
#if ROUTING_CONF_RPL_LITE
#include "net/routing/rpl-lite/rpl.h"
@ -83,6 +84,11 @@ tsch_rpl_callback_joining_network(void)
void
tsch_rpl_callback_leaving_network(void)
{
/* Forget past link statistics. If we are leaving a TSCH
network, there are changes we've been out of sync in the recent past, and
as a result have irrelevant link statistices. */
link_stats_reset();
/* RPL local repair */
NETSTACK_ROUTING.local_repair("TSCH leaving");
}
/*---------------------------------------------------------------------------*/