* Neighbor Cache
*
* FIXME: Use hashing to get some real speed.
- * FIXME: Cleanup when a protocol goes down.
*/
static slab *neigh_slab;
}
}
+void
+neigh_prune(void)
+{
+ neighbor *n, *m, **N;
+ struct iface *i;
+
+ DBG("Pruning neighbors\n");
+ WALK_LIST(i, iface_list)
+ {
+ N = &i->neigh;
+ while (n = *N)
+ {
+ if (n->proto->core_state == FS_HUNGRY || n->proto->core_state == FS_FLUSHING)
+ {
+ *N = n->sibling;
+ rem_node(&n->n);
+ sl_free(neigh_slab, n);
+ continue;
+ }
+ N = &n->sibling;
+ }
+ }
+}
+
/*
* The Interface List
*/