diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-04 19:39:47 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-04 19:39:47 +0000 |
commit | 5b0dae60071f3691da10254fc987c1f5f086e9ad (patch) | |
tree | 407496dab0c706903e705cc31bec478982404159 /usr.sbin/bgpd/session.c | |
parent | f96f673c3d6c854eb7853103f6a09e6b33c4ace0 (diff) |
-new imsg CTL_RELOAD
-upong receival in the SE forward to parent
-make sending messages from SE to parent work for that (was not required before)
-parent reacts to that just like a SIGHUP, reread config file
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r-- | usr.sbin/bgpd/session.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index f7df8dfbc99..3294be71ab0 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.60 2004/01/04 18:51:23 henning Exp $ */ +/* $OpenBSD: session.c,v 1.61 2004/01/04 19:39:46 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -186,6 +186,8 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], pfd[PFD_LISTEN].events = POLLIN; pfd[PFD_PIPE_MAIN].fd = ibuf_main.sock; pfd[PFD_PIPE_MAIN].events = POLLIN; + if (ibuf_main.w.queued > 0) + pfd[PFD_PIPE_MAIN].events |= POLLOUT; pfd[PFD_PIPE_ROUTE].fd = ibuf_rde.sock; pfd[PFD_PIPE_ROUTE].events = POLLIN; if (ibuf_rde.w.queued > 0) @@ -281,6 +283,10 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2], session_accept(sock); } + if (nfds > 0 && pfd[PFD_PIPE_MAIN].revents & POLLOUT) + if (msgbuf_write(&ibuf_main.w) < 0) + fatal("pipe write error"); + if (nfds > 0 && pfd[PFD_PIPE_MAIN].revents & POLLIN) { nfds--; session_dispatch_imsg(&ibuf_main, PFD_PIPE_MAIN); @@ -1410,3 +1416,9 @@ session_up(struct peer *peer) &peer->remote_bgpid, sizeof(peer->remote_bgpid)) == -1) fatalx("imsg_compose error"); } + +int +imsg_compose_parent(int type, u_int32_t peerid, void *data, u_int16_t datalen) +{ + return (imsg_compose(&ibuf_main, type, peerid, data, datalen)); +}
\ No newline at end of file |