-/* $OpenBSD: control.c,v 1.3 2018/04/26 17:08:18 florian Exp $ */
+/* $OpenBSD: control.c,v 1.4 2018/08/04 09:36:49 florian Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
return (0);
}
-void
-control_cleanup(char *path)
-{
- if (path == NULL)
- return;
- event_del(&control_state.ev);
- event_del(&control_state.evt);
- if (unlink(path) != 0)
- log_warn("unlink %s", path);
-}
-
void
control_accept(int listenfd, short event, void *bula)
{
-/* $OpenBSD: control.h,v 1.2 2017/07/06 15:02:53 florian Exp $ */
+/* $OpenBSD: control.h,v 1.3 2018/08/04 09:36:49 florian Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
void control_accept(int, short, void *);
void control_dispatch_imsg(int, short, void *);
int control_imsg_relay(struct imsg *);
-void control_cleanup(char *);
#endif /* SMALL */
-/* $OpenBSD: slaacd.c,v 1.28 2018/07/27 06:20:01 bket Exp $ */
+/* $OpenBSD: slaacd.c,v 1.29 2018/08/04 09:36:49 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
pid_t frontend_pid;
pid_t engine_pid;
-int routesock, ioctl_sock;
-
-char *csock;
-
-int rtm_seq = 0;
+int routesock, ioctl_sock, rtm_seq = 0;
void
main_sig_handler(int sig, short event, void *arg)
int pipe_main2engine[2];
int icmp6sock, on = 1;
int frontend_routesock, rtfilter;
+ char *csock = SLAACD_SOCKET;
#ifndef SMALL
int control_fd;
#endif /* SMALL */
- csock = SLAACD_SOCKET;
-
log_init(1, LOG_DAEMON); /* Log to stderr until daemonized. */
log_setverbose(1);
fatalx("control socket setup failed");
#endif /* SMALL */
- if (pledge("stdio cpath sendfd wroute", NULL) == -1)
+ if (pledge("stdio sendfd wroute", NULL) == -1)
fatal("pledge");
main_imsg_compose_frontend_fd(IMSG_ICMP6SOCK, 0, icmp6sock);
free(iev_frontend);
free(iev_engine);
-#ifndef SMALL
- control_cleanup(csock);
-#endif /* SMALL */
-
log_info("terminating");
exit(0);
}
switch (imsg.hdr.type) {
case IMSG_STARTUP_DONE:
- if (pledge("stdio cpath wroute", NULL) == -1)
+ if (pledge("stdio wroute", NULL) == -1)
fatal("pledge");
break;
#ifndef SMALL