From c6c67608387f244df4161d788896ff3715a885d8 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Mon, 7 Jun 2010 13:40:05 +0000 Subject: [PATCH] Validate incoming DTSN value --- core/net/rpl/rpl-dag.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index bf54ad139..5b2786f05 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -32,7 +32,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rpl-dag.c,v 1.20 2010/06/07 11:36:02 nvt-se Exp $ + * $Id: rpl-dag.c,v 1.21 2010/06/07 13:40:05 nvt-se Exp $ */ /** * \file @@ -545,7 +545,9 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) return; } - dag->dtsn = dio->dtsn; + if(dag->rank != ROOT_RANK && dag->dtsn < dio->dtsn || dag->dtsn == ~0) { + dag->dtsn = dio->dtsn; + } /* This DIO pertains to a DAG that we are already part of. */ p = rpl_find_parent(dag, from);