summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>1998-12-22 19:55:49 +0100
committerPavel Machek <pavel@ucw.cz>1998-12-22 19:55:49 +0100
commitce45fc128783ea7b93bd7ebd5ac4eec763adbb40 (patch)
tree369cb9999d3facb31038bde5cbd6428ca50a1c44
parent852fc0af31ed885e355bb1d14ce0e4468830c359 (diff)
downloadbird-ce45fc128783ea7b93bd7ebd5ac4eec763adbb40.tar
bird-ce45fc128783ea7b93bd7ebd5ac4eec763adbb40.zip
Allow NULL to init_fib().
-rw-r--r--nest/rt-fib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/nest/rt-fib.c b/nest/rt-fib.c
index f436525..fd5c51b 100644
--- a/nest/rt-fib.c
+++ b/nest/rt-fib.c
@@ -51,6 +51,11 @@ fib_hash(struct fib *f, ip_addr *a)
return ipa_hash(*a) >> f->hash_shift;
}
+static void *
+fib_dummy_init(struct fib_node *)
+{
+}
+
void
fib_init(struct fib *f, pool *p, unsigned node_size, unsigned hash_order, void (*init)(struct fib_node *))
{
@@ -63,7 +68,7 @@ fib_init(struct fib *f, pool *p, unsigned node_size, unsigned hash_order, void (
bzero(f->hash_table, f->hash_size * sizeof(struct fib_node *));
f->entries = 0;
f->entries_min = 0;
- f->init = init;
+ f->init = init ? : fib_dummy_init;
}
static void