diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-24 20:09:58 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-24 20:09:58 +0000 |
commit | b8c6b47a906216a3c6668e007322e2e7298560d7 (patch) | |
tree | fe3a126e16c42ff34de29eafbd01b1bbe21da0c3 /usr.sbin | |
parent | 773b2797d0667b7493ddae968f2d78e5b54c673d (diff) |
now that the main process can cleanup without RDE's help, we do not need the
somewhat fragile IMSG_SHUTDOWN_* stuff any more. speeds shutdown up
enourmously.
ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 25 | ||||
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 7 |
4 files changed, 7 insertions, 37 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 4ee58c247e9..31d60e0bac3 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.24 2003/12/24 19:59:24 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.25 2003/12/24 20:09:56 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -47,11 +47,6 @@ volatile sig_atomic_t quit = 0; volatile sig_atomic_t reconfig = 0; struct imsgbuf ibuf_se; struct imsgbuf ibuf_rde; -int se_done = 0; -int rde_done = 0; - -#define QUIT_REQUESTED 1 -#define QUIT_INPROGRESS 2 void sighdlr(int sig) @@ -60,7 +55,7 @@ sighdlr(int sig) case SIGTERM: case SIGINT: case SIGCHLD: - quit = QUIT_REQUESTED; + quit = 1; break; case SIGHUP: reconfig = 1; @@ -199,7 +194,7 @@ main(int argc, char *argv[]) imsg_init(&ibuf_rde, pipe_m2r[0]); rfd = kroute_init(); - while (quit != QUIT_INPROGRESS || se_done == 0 || rde_done == 0) { + while (quit == 0) { pfd[PFD_PIPE_SESSION].fd = ibuf_se.sock; pfd[PFD_PIPE_SESSION].events = POLLIN; if (ibuf_se.w.queued) @@ -253,14 +248,6 @@ main(int argc, char *argv[]) reconfig = 0; } - if (quit == QUIT_REQUESTED) { - imsg_compose(&ibuf_se, IMSG_SHUTDOWN_REQUEST, 0, - NULL, 0); - imsg_compose(&ibuf_rde, IMSG_SHUTDOWN_REQUEST, 0, - NULL, 0); - quit = QUIT_INPROGRESS; - } - if (mrtdump == 1) { mrt_alrm(&mrtconf, &ibuf_rde); mrtdump = 0; @@ -365,12 +352,6 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct mrt_config *conf) if (kroute_delete(rfd, imsg.data)) fatal("kroute_delete error", errno); break; - case IMSG_SHUTDOWN_DONE: - if (idx == PFD_PIPE_ROUTE) - rde_done = 1; - else - se_done = 1; - break; default: break; } diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index e769662c8a8..b4bc9f1fab8 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.18 2003/12/24 19:59:24 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.19 2003/12/24 20:09:57 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -214,9 +214,7 @@ enum imsg_type { IMSG_MRT_END, IMSG_KROUTE_ADD, IMSG_KROUTE_CHANGE, - IMSG_KROUTE_DELETE, - IMSG_SHUTDOWN_REQUEST, - IMSG_SHUTDOWN_DONE + IMSG_KROUTE_DELETE }; struct imsg_hdr { diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index db7aa6d758a..fb4792d4c70 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.26 2003/12/24 19:59:24 henning Exp $ */ +/* $OpenBSD: rde.c,v 1.27 2003/12/24 20:09:57 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -252,10 +252,6 @@ rde_dispatch_imsg(struct imsgbuf *ibuf, int idx) imsg_compose(&ibuf_main, IMSG_MRT_END, imsg.hdr.peerid, NULL, 0); break; - case IMSG_SHUTDOWN_REQUEST: - imsg_compose(&ibuf_main, IMSG_SHUTDOWN_DONE, 0, - NULL, 0); - break; default: break; } diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 111f7bbe2ae..3db86290467 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.34 2003/12/24 13:28:02 henning Exp $ */ +/* $OpenBSD: session.c,v 1.35 2003/12/24 20:09:57 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -1298,11 +1298,6 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx) pending_reconf = 0; logit(LOG_INFO, "SE reconfigured"); break; - case IMSG_SHUTDOWN_REQUEST: - session_terminate(); - imsg_compose(&ibuf_main, IMSG_SHUTDOWN_DONE, 0, - NULL, 0); - break; default: } imsg_free(&imsg); |