diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2019-01-29 15:43:34 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2019-01-29 15:43:34 +0000 |
commit | b58fdbd7ddc30e7ceb460fb56f3057f30dfae5c5 (patch) | |
tree | 2582adab505529f15844e8bc83ca8c09f4e5c776 /usr.sbin | |
parent | 1c9cdf476d76350977c8f3bd26f5e3f81887c77d (diff) |
We don't need IMSG_SHUTDOWN, we can just close the sockets.
pointed out by deraadt
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rad/engine.c | 5 | ||||
-rw-r--r-- | usr.sbin/rad/frontend.c | 8 | ||||
-rw-r--r-- | usr.sbin/rad/rad.c | 11 | ||||
-rw-r--r-- | usr.sbin/rad/rad.h | 3 |
4 files changed, 5 insertions, 22 deletions
diff --git a/usr.sbin/rad/engine.c b/usr.sbin/rad/engine.c index 02f1a68ce0c..0b3d58ab790 100644 --- a/usr.sbin/rad/engine.c +++ b/usr.sbin/rad/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.9 2018/08/03 13:14:46 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.10 2019/01/29 15:43:33 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -236,9 +236,6 @@ engine_dispatch_frontend(int fd, short event, void *bula) memcpy(&verbose, imsg.data, sizeof(verbose)); log_setverbose(verbose); break; - case IMSG_SHUTDOWN: - engine_imsg_compose_frontend(IMSG_SHUTDOWN, 0, NULL, 0); - break; default: log_debug("%s: unexpected imsg %d", __func__, imsg.hdr.type); diff --git a/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c index 57f725f06f7..4621c5f25c3 100644 --- a/usr.sbin/rad/frontend.c +++ b/usr.sbin/rad/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.19 2018/11/28 06:41:31 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.20 2019/01/29 15:43:33 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -458,9 +458,6 @@ frontend_dispatch_main(int fd, short event, void *bula) TAILQ_INIT(&ctl_conns); control_listen(); break; - case IMSG_SHUTDOWN: - frontend_imsg_compose_engine(IMSG_SHUTDOWN, 0, NULL, 0); - break; default: log_debug("%s: error handling imsg %d", __func__, imsg.hdr.type); @@ -528,9 +525,6 @@ frontend_dispatch_engine(int fd, short event, void *bula) free_ra_iface(ra_iface); } break; - case IMSG_SHUTDOWN: - frontend_imsg_compose_main(IMSG_SHUTDOWN, 0, NULL, 0); - break; default: log_debug("%s: error handling imsg %d", __func__, imsg.hdr.type); diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c index d7d9f21f98a..650a260ddd5 100644 --- a/usr.sbin/rad/rad.c +++ b/usr.sbin/rad/rad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rad.c,v 1.17 2019/01/22 09:25:29 krw Exp $ */ +/* $OpenBSD: rad.c,v 1.18 2019/01/29 15:43:33 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -82,8 +82,6 @@ uint32_t cmd_opts; void main_sig_handler(int sig, short event, void *arg) { - struct rad_conf empty_conf; - /* * Normal signal handler rules don't apply because libevent * decouples for us. @@ -92,9 +90,7 @@ main_sig_handler(int sig, short event, void *arg) switch (sig) { case SIGTERM: case SIGINT: - memset(&empty_conf, 0, sizeof(empty_conf)); - (void)main_imsg_send_config(&empty_conf); - (void)main_imsg_compose_frontend(IMSG_SHUTDOWN, 0, NULL, 0); + main_shutdown(); break; case SIGHUP: if (main_reload() == -1) @@ -435,9 +431,6 @@ main_dispatch_frontend(int fd, short event, void *bula) memcpy(&verbose, imsg.data, sizeof(verbose)); log_setverbose(verbose); break; - case IMSG_SHUTDOWN: - shut = 1; - break; default: log_debug("%s: error handling imsg %d", __func__, imsg.hdr.type); diff --git a/usr.sbin/rad/rad.h b/usr.sbin/rad/rad.h index cd16a0a36db..2390223a1eb 100644 --- a/usr.sbin/rad/rad.h +++ b/usr.sbin/rad/rad.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rad.h,v 1.15 2018/08/03 13:14:46 florian Exp $ */ +/* $OpenBSD: rad.h,v 1.16 2019/01/29 15:43:33 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -71,7 +71,6 @@ enum imsg_type { IMSG_SEND_RA, IMSG_UPDATE_IF, IMSG_REMOVE_IF, - IMSG_SHUTDOWN, IMSG_SOCKET_IPC }; |