summaryrefslogtreecommitdiff
path: root/proto/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bfd')
-rw-r--r--proto/bfd/Makefile3
-rw-r--r--proto/bfd/bfd.c19
-rw-r--r--proto/bfd/io.c2
3 files changed, 13 insertions, 11 deletions
diff --git a/proto/bfd/Makefile b/proto/bfd/Makefile
index 402122fc..dbdc0a09 100644
--- a/proto/bfd/Makefile
+++ b/proto/bfd/Makefile
@@ -2,5 +2,6 @@ src := bfd.c io.c packets.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,bfd_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c
index cc941695..873e2ed5 100644
--- a/proto/bfd/bfd.c
+++ b/proto/bfd/bfd.c
@@ -113,8 +113,8 @@
#define HASH_IP_EQ(a1,n1,a2,n2) ipa_equal(a1, a2) && n1 == n2
#define HASH_IP_FN(a,n) ipa_hash(a) ^ u32_hash(n)
-static list bfd_proto_list;
-static list bfd_wait_list;
+static list STATIC_LIST_INIT(bfd_proto_list);
+static list STATIC_LIST_INIT(bfd_wait_list);
const char *bfd_state_names[] = { "AdminDown", "Down", "Init", "Up" };
@@ -508,7 +508,7 @@ bfd_remove_session(struct bfd_proto *p, struct bfd_session *s)
HASH_REMOVE(p->session_hash_id, HASH_ID, s);
HASH_REMOVE(p->session_hash_ip, HASH_IP, s);
- sl_free(p->session_slab, s);
+ sl_free(s);
TRACE(D_EVENTS, "Session to %I removed", ip);
@@ -1007,13 +1007,6 @@ bfd_notify_init(struct bfd_proto *p)
* BFD protocol glue
*/
-void
-bfd_init_all(void)
-{
- init_list(&bfd_proto_list);
- init_list(&bfd_wait_list);
-}
-
static struct proto *
bfd_init(struct proto_config *c)
{
@@ -1199,3 +1192,9 @@ struct protocol proto_bfd = {
.reconfigure = bfd_reconfigure,
.copy_config = bfd_copy_config,
};
+
+void
+bfd_build(void)
+{
+ proto_build(&proto_bfd);
+}
diff --git a/proto/bfd/io.c b/proto/bfd/io.c
index 1cd9365a..e696cc89 100644
--- a/proto/bfd/io.c
+++ b/proto/bfd/io.c
@@ -482,6 +482,8 @@ birdloop_main(void *arg)
birdloop_set_current(loop);
+ tmp_init(loop->pool);
+
pthread_mutex_lock(&loop->mutex);
while (1)
{