diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-04 12:43:37 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-04 12:43:37 +0000 |
commit | deb608b55212d1d748b2fc1e22ebb1207cf73810 (patch) | |
tree | a87bce793a097e005ca8582d8206a278fc5c0d20 /usr.sbin | |
parent | 324d775f11fb4a7bfc76acb7f35599e0d08d239f (diff) |
Do not run rde_shutdown() unless bgpd is started with -d.
On some of my systems rde_shutdown() takes more than 3min doing nothing more
than calling free(3) over and over again.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.c | 9 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 5 |
3 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index af2d9f1c813..10a0de070ff 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.140 2006/11/28 16:39:34 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.141 2007/01/04 12:43:36 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -216,7 +216,7 @@ main(int argc, char *argv[]) /* fork children */ rde_pid = rde_main(&conf, peer_l, &net_l, rules_l, &mrt_l, - pipe_m2r, pipe_s2r, pipe_m2s); + pipe_m2r, pipe_s2r, pipe_m2s, debug); io_pid = session_main(&conf, peer_l, &net_l, rules_l, &mrt_l, pipe_m2s, pipe_s2r, pipe_m2r); diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index ec5e0b5755f..682b616e209 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.215 2006/12/12 10:19:44 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.216 2007/01/04 12:43:36 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -124,7 +124,8 @@ u_int32_t nexthophashsize = 64; pid_t rde_main(struct bgpd_config *config, struct peer *peer_l, struct network_head *net_l, struct filter_head *rules, - struct mrt_head *mrt_l, int pipe_m2r[2], int pipe_s2r[2], int pipe_m2s[2]) + struct mrt_head *mrt_l, int pipe_m2r[2], int pipe_s2r[2], int pipe_m2s[2], + int debug) { pid_t pid; struct passwd *pw; @@ -271,7 +272,9 @@ rde_main(struct bgpd_config *config, struct peer *peer_l, rde_update6_queue_runner(); } - rde_shutdown(); + /* do not clean up on shutdown on production, it takes ages. */ + if (debug) + rde_shutdown(); msgbuf_write(&ibuf_se->w); msgbuf_clear(&ibuf_se->w); diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 9d53860cdb7..8d95671c438 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.88 2006/10/26 14:26:49 henning Exp $ */ +/* $OpenBSD: session.h,v 1.89 2007/01/04 12:43:36 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -228,7 +228,8 @@ void prepare_listeners(struct bgpd_config *); /* rde.c */ pid_t rde_main(struct bgpd_config *, struct peer *, struct network_head *, - struct filter_head *, struct mrt_head *, int[2], int[2], int[2]); + struct filter_head *, struct mrt_head *, int[2], int[2], int[2], + int); /* control.c */ int control_init(int, char *); |