summaryrefslogtreecommitdiff
path: root/nest/neighbor.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-08 10:13:59 +0000
committerMartin Mares <mj@ucw.cz>2000-05-08 10:13:59 +0000
commit18c031fae8945409b0ff1139d88092ba19ec2780 (patch)
tree475eae1ee9aa0f8643b0299b29c1ba38dde86b7b /nest/neighbor.c
parent0d3070824da904bd0f3f576b353b738bfa15a53a (diff)
Debugged printing and pruning of neighbor cache entries.
Diffstat (limited to 'nest/neighbor.c')
-rw-r--r--nest/neighbor.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c
index ef1df865..55222383 100644
--- a/nest/neighbor.c
+++ b/nest/neighbor.c
@@ -128,7 +128,8 @@ neigh_dump_all(void)
WALK_LIST(n, sticky_neigh_list)
neigh_dump(n);
for(i=0; i<NEIGH_HASH_SIZE; i++)
- WALK_LIST(n, neigh_hash_table[i]);
+ WALK_LIST(n, neigh_hash_table[i])
+ neigh_dump(n);
debug("\n");
}
@@ -171,6 +172,17 @@ neigh_if_down(struct iface *i)
}
}
+static inline void
+neigh_prune_one(neighbor *n)
+{
+ if (n->proto->core_state != FS_FLUSHING)
+ return;
+ rem_node(&n->n);
+ if (n->iface)
+ rem_node(&n->if_n);
+ sl_free(neigh_slab, n);
+}
+
void
neigh_prune(void)
{
@@ -181,13 +193,9 @@ neigh_prune(void)
DBG("Pruning neighbors\n");
for(i=0; i<NEIGH_HASH_SIZE; i++)
WALK_LIST_DELSAFE(n, m, neigh_hash_table[i])
- if (n->proto->core_state == FS_FLUSHING)
- {
- rem_node(&n->n);
- if (n->iface)
- rem_node(&n->if_n);
- sl_free(neigh_slab, n);
- }
+ neigh_prune_one(n);
+ WALK_LIST_DELSAFE(n, m, sticky_neigh_list)
+ neigh_prune_one(n);
}
void