summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authordv <dv@cvs.openbsd.org>2021-04-20 21:11:57 +0000
committerdv <dv@cvs.openbsd.org>2021-04-20 21:11:57 +0000
commit5a401f487ba224cdb6435e333467c201bed24165 (patch)
tree6fe62e2502d1c4eb8c77d6ddabbaba1ba20cd41d /sbin/iked
parentd00d6317e4be65265c78d6bdc9a5169fd2493ce8 (diff)
Move TAILQ initialization to files where they are used.
These priv-sep daemons all follow a similar design and use TAILQs for tracking control process connections. In most cases, the TAILQs are initialized separate from where they are used. Since the scope of use is generally confined to a specific control process file, this commit also removes any extern definitions and exposing the TAILQ structures to other compilation units. ok bluhm@, tb@
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/control.c4
-rw-r--r--sbin/iked/iked.h3
-rw-r--r--sbin/iked/proc.c3
3 files changed, 4 insertions, 6 deletions
diff --git a/sbin/iked/control.c b/sbin/iked/control.c
index 4328f5a0208..17b72805de0 100644
--- a/sbin/iked/control.c
+++ b/sbin/iked/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.30 2020/10/09 08:59:15 tobhe Exp $ */
+/* $OpenBSD: control.c,v 1.31 2021/04/20 21:11:56 dv Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -35,7 +35,7 @@
#define CONTROL_BACKLOG 5
-struct ctl_connlist ctl_conns;
+struct ctl_connlist ctl_conns = TAILQ_HEAD_INITIALIZER(ctl_conns);
void
control_accept(int, short, void *);
diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h
index a58b08f9488..06c566d1dc2 100644
--- a/sbin/iked/iked.h
+++ b/sbin/iked/iked.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.h,v 1.189 2021/03/05 22:26:04 tobhe Exp $ */
+/* $OpenBSD: iked.h,v 1.190 2021/04/20 21:11:56 dv Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -97,7 +97,6 @@ struct ctl_conn {
struct imsgev iev;
};
TAILQ_HEAD(ctl_connlist, ctl_conn);
-extern struct ctl_connlist ctl_conns;
extern enum privsep_procid privsep_process;
diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c
index ad89aa82e13..076fec43ade 100644
--- a/sbin/iked/proc.c
+++ b/sbin/iked/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.34 2021/01/28 01:20:37 mortimer Exp $ */
+/* $OpenBSD: proc.c,v 1.35 2021/04/20 21:11:56 dv Exp $ */
/*
* Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -431,7 +431,6 @@ proc_run(struct privsep *ps, struct privsep_proc *p,
proc_listen(ps, procs, nproc);
if (p->p_id == PROC_CONTROL && ps->ps_instance == 0) {
- TAILQ_INIT(&ctl_conns);
if (control_listen(&ps->ps_csock) == -1)
fatalx(__func__);
TAILQ_FOREACH(rcs, &ps->ps_rcsocks, cs_entry)