summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authordenis <denis@openbsd.org>2020-01-01 10:09:34 +0000
committerdenis <denis@openbsd.org>2020-01-01 10:09:34 +0000
commitb529fab903ecbe25a1449198119112896dc5c55b (patch)
tree416db9b7d40efef81130128c16c89e004dea446f /usr.sbin/ospf6d
parentAcknowledge SMP kernels in INSTALL.octeon (diff)
downloadwireguard-openbsd-b529fab903ecbe25a1449198119112896dc5c55b.tar.xz
wireguard-openbsd-b529fab903ecbe25a1449198119112896dc5c55b.zip
Cleanup control.
"Looks fine" deraadt@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/control.c12
-rw-r--r--usr.sbin/ospf6d/ospfe.c6
2 files changed, 7 insertions, 11 deletions
diff --git a/usr.sbin/ospf6d/control.c b/usr.sbin/ospf6d/control.c
index 191d09c25c1..72f91b42faa 100644
--- a/usr.sbin/ospf6d/control.c
+++ b/usr.sbin/ospf6d/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.27 2018/09/01 19:21:10 remi Exp $ */
+/* $OpenBSD: control.c,v 1.28 2020/01/01 10:09:34 denis Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -64,7 +64,6 @@ control_check(char *path)
return (0);
}
-
int
control_init(char *path)
{
@@ -127,10 +126,11 @@ control_listen(void)
void
control_cleanup(char *path)
{
+ if (path == NULL)
+ return;
event_del(&control_state.ev);
event_del(&control_state.evt);
- if (path)
- unlink(path);
+ unlink(path);
}
/* ARGSUSED */
@@ -237,7 +237,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
{
struct ctl_conn *c;
struct imsg imsg;
- int n;
+ ssize_t n;
unsigned int ifidx;
int verbose;
@@ -289,7 +289,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
sizeof(ifidx)) {
memcpy(&ifidx, imsg.data, sizeof(ifidx));
ospfe_iface_ctl(c, ifidx);
- imsg_compose(&c->iev.ibuf, IMSG_CTL_END, 0,
+ imsg_compose_event(&c->iev, IMSG_CTL_END, 0,
0, -1, NULL, 0);
}
break;
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index ffdec467e84..5d0744681f7 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.59 2019/12/28 09:25:24 denis Exp $ */
+/* $OpenBSD: ospfe.c,v 1.60 2020/01/01 10:09:34 denis Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -175,10 +175,6 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2],
/* remove unneeded config stuff */
conf_clear_redist_list(&oeconf->redist_list);
- /* listen on ospfd control socket */
- TAILQ_INIT(&ctl_conns);
- control_listen();
-
if ((pkt_ptr = calloc(1, READ_BUF_SIZE)) == NULL)
fatal("ospfe");