From acf45ec648f37a140b0e705c240886302fbc9a92 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 9 Jan 2011 21:20:05 +0000 Subject: [PATCH] Bugfix: memory wasn't freed when a neighbor was dropped from the list. Also increase the max age to 180 minutes to allow for regular beacons to refresh the neighbor before it is dropped. --- core/net/rime/collect-neighbor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/net/rime/collect-neighbor.c b/core/net/rime/collect-neighbor.c index 06d61a284..7e91ce855 100644 --- a/core/net/rime/collect-neighbor.c +++ b/core/net/rime/collect-neighbor.c @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: collect-neighbor.c,v 1.8 2010/10/11 23:38:46 adamdunkels Exp $ + * $Id: collect-neighbor.c,v 1.9 2011/01/09 21:20:05 adamdunkels Exp $ */ /** @@ -63,7 +63,7 @@ MEMB(collect_neighbors_mem, struct collect_neighbor, MAX_COLLECT_NEIGHBORS); -#define MAX_AGE 60 +#define MAX_AGE 180 #define MAX_LE_AGE 10 #define PERIODIC_INTERVAL CLOCK_SECOND * 60 @@ -98,6 +98,7 @@ periodic(void *ptr) n->le_age = 0; } if(n->age == MAX_AGE) { + memb_free(&collect_neighbors_mem, n); list_remove(neighbor_list->list, n); n = list_head(neighbor_list->list); }