summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-01-19 10:37:26 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-01-19 10:37:26 +0000
commit27a9ba5a56cef3e648ad90ce08195600c7cfa81c (patch)
tree373167a9fff5b6be66856710bd2519bfcfc35c1e /usr.sbin
parent63efe746142bbd099cb54c2ac9a25b4b97086974 (diff)
Same control cleanup that was done for ospfd and ripd. Move the
control_state and ctl_conns structs into control.c nothing else uses these structs.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/eigrpd/control.c12
-rw-r--r--usr.sbin/eigrpd/control.h8
-rw-r--r--usr.sbin/eigrpd/eigrpe.c3
-rw-r--r--usr.sbin/eigrpd/eigrpe.h6
4 files changed, 15 insertions, 14 deletions
diff --git a/usr.sbin/eigrpd/control.c b/usr.sbin/eigrpd/control.c
index a3d1aea48b6..14e955df809 100644
--- a/usr.sbin/eigrpd/control.c
+++ b/usr.sbin/eigrpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.8 2018/08/05 08:10:35 mestre Exp $ */
+/* $OpenBSD: control.c,v 1.9 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -30,6 +30,8 @@
#include "control.h"
#include "log.h"
+TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns = TAILQ_HEAD_INITIALIZER(ctl_conns);
+
#define CONTROL_BACKLOG 5
static void control_accept(int, short, void *);
@@ -38,6 +40,13 @@ static struct ctl_conn *control_connbypid(pid_t);
static void control_close(int);
static void control_dispatch_imsg(int, short, void *);
+struct {
+ struct event ev;
+ struct event evt;
+ int fd;
+} control_state;
+
+
int
control_init(char *path)
{
@@ -86,7 +95,6 @@ control_init(char *path)
int
control_listen(void)
{
-
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
log_warn("%s: listen", __func__);
return (-1);
diff --git a/usr.sbin/eigrpd/control.h b/usr.sbin/eigrpd/control.h
index 4e395cf3923..fe9eb692586 100644
--- a/usr.sbin/eigrpd/control.h
+++ b/usr.sbin/eigrpd/control.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.h,v 1.4 2018/08/05 08:10:35 mestre Exp $ */
+/* $OpenBSD: control.h,v 1.5 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -23,12 +23,6 @@
#include <event.h>
-struct {
- struct event ev;
- struct event evt;
- int fd;
-} control_state;
-
struct ctl_conn {
TAILQ_ENTRY(ctl_conn) entry;
struct imsgev iev;
diff --git a/usr.sbin/eigrpd/eigrpe.c b/usr.sbin/eigrpd/eigrpe.c
index 63f53211dac..2b1eb749a90 100644
--- a/usr.sbin/eigrpd/eigrpe.c
+++ b/usr.sbin/eigrpd/eigrpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eigrpe.c,v 1.37 2021/01/19 10:31:12 claudio Exp $ */
+/* $OpenBSD: eigrpe.c,v 1.38 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -164,7 +164,6 @@ eigrpe(int debug, int verbose, char *sockname)
event_add(&ev6, NULL);
/* listen on eigrpd control socket */
- TAILQ_INIT(&ctl_conns);
control_listen();
event_dispatch();
diff --git a/usr.sbin/eigrpd/eigrpe.h b/usr.sbin/eigrpd/eigrpe.h
index 2d0198bc26a..847c7be2d10 100644
--- a/usr.sbin/eigrpd/eigrpe.h
+++ b/usr.sbin/eigrpd/eigrpe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: eigrpe.h,v 1.17 2021/01/19 10:31:12 claudio Exp $ */
+/* $OpenBSD: eigrpe.h,v 1.18 2021/01/19 10:37:25 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -25,8 +25,6 @@
#include <event.h>
-TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns;
-
struct pbuf {
struct ibuf *buf;
int refcnt;
@@ -73,6 +71,8 @@ RB_PROTOTYPE(nbr_pid_head, nbr, pid_tree, nbr_pid_compare)
extern struct eigrpd_conf *econf;
+struct ctl_conn;
+
/* eigrpe.c */
void eigrpe(int, int, char *);
int eigrpe_imsg_compose_parent(int, pid_t, void *, uint16_t);