summaryrefslogtreecommitdiff
path: root/proto/bfd
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-18 22:05:50 +0100
committerMaria Matejka <mq@ucw.cz>2022-04-06 18:14:08 +0200
commit4a23ede2b056a41456790cc20a0c3d92a7137693 (patch)
tree179c6f0ae13604cb85e9f10729818ef0b131e9a1 /proto/bfd
parent0f68515263e91dd49b2d845cdff35af40c064dc2 (diff)
Protocols have their own explicit init routines
Diffstat (limited to 'proto/bfd')
-rw-r--r--proto/bfd/Makefile3
-rw-r--r--proto/bfd/bfd.c17
2 files changed, 10 insertions, 10 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 277f38bf..d1e97cd5 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" };
@@ -998,13 +998,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)
{
@@ -1186,3 +1179,9 @@ struct protocol proto_bfd = {
.reconfigure = bfd_reconfigure,
.copy_config = bfd_copy_config,
};
+
+void
+bfd_build(void)
+{
+ proto_build(&proto_bfd);
+}