Always add neighbors to the list regardless if their rtmetric is higher than ours or not. If our rtmetric rises, we may need ot have those neighbors in our list.

This commit is contained in:
adamdunkels 2007-11-26 23:31:44 +00:00
parent 98854f80e0
commit f6cf045413

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: tree.c,v 1.15 2007/11/17 18:05:21 adamdunkels Exp $
* $Id: tree.c,v 1.16 2007/11/26 23:31:44 adamdunkels Exp $
*/
/**
@ -249,9 +249,7 @@ adv_received(struct nbh_conn *c, rimeaddr_t *from, uint16_t rtmetric)
n = neighbor_find(from);
if(n == NULL) {
if(rtmetric < tc->local_rtmetric) {
neighbor_add(from, rtmetric, 1);
}
} else {
neighbor_update(n, rtmetric);
PRINTF("%d.%d: updating neighbor %d.%d, etx %d, hops %d\n",