We found that the preferred parent should be reset in the rpl_remove_parent function.

This commit is contained in:
nifi 2010-10-27 12:20:35 +00:00
parent d528039f9a
commit d2a3f1f257
1 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rpl-dag.c,v 1.35 2010/10/27 00:46:40 nvt-se Exp $
* $Id: rpl-dag.c,v 1.36 2010/10/27 12:20:35 nifi Exp $
*/
/**
* \file
@ -361,6 +361,10 @@ rpl_remove_parent(rpl_dag_t *dag, rpl_parent_t *parent)
PRINT6ADDR(&parent->addr);
PRINTF("\n");
if(parent == dag->preferred_parent) {
dag->preferred_parent = NULL;
}
list_remove(dag->parents, parent);
memb_free(&parent_memb, parent);
return 0;