From 0f19558f9f07930052353aba7b3d13834b933bca Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 10 Mar 2004 14:29:38 +0000 Subject: when we exit try to write out what is left in the msg buffers for the imsg pipes and clear buffers afterwards --- usr.sbin/bgpd/rde.c | 7 ++++++- usr.sbin/bgpd/session.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index fabeb4f7700..b82b3ffeac8 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.94 2004/03/05 22:21:32 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.95 2004/03/10 14:29:37 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -186,6 +186,11 @@ rde_main(struct bgpd_config *config, struct peer *peer_l, rde_update_queue_runner(); } + msgbuf_write(&ibuf_se.w); + msgbuf_clear(&ibuf_se.w); + msgbuf_write(&ibuf_main.w); + msgbuf_clear(&ibuf_main.w); + log_info("route decision engine exiting"); _exit(0); } diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index fbab673f156..61477b44e11 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.129 2004/03/10 13:45:16 henning Exp $ */ +/* $OpenBSD: session.c,v 1.130 2004/03/10 14:29:37 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -348,6 +348,11 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], for (p = peers; p != NULL; p = p->next) bgp_fsm(p, EVNT_STOP); + msgbuf_write(&ibuf_rde.w); + msgbuf_clear(&ibuf_rde.w); + msgbuf_write(&ibuf_main.w); + msgbuf_clear(&ibuf_main.w); + control_shutdown(); log_info("session engine exiting"); _exit(0); -- cgit v1.2.3