diff options
author | 2004-01-05 16:21:14 +0000 | |
---|---|---|
committer | 2004-01-05 16:21:14 +0000 | |
commit | 192b746054357834c60826f7487e9bc6db8b72a9 (patch) | |
tree | c05e468bf05f5b3ee10d61ed6f1201840682c106 | |
parent | protect against trying to couple when we're already coupled to the fib, (diff) | |
download | wireguard-openbsd-192b746054357834c60826f7487e9bc6db8b72a9.tar.xz wireguard-openbsd-192b746054357834c60826f7487e9bc6db8b72a9.zip |
allow fib couple/decouple based on an imsg received on the control socket
by the SE and passed on to the main process
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 14 | ||||
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/control.c | 6 |
3 files changed, 21 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 2254203a2f0..7b5a712cb75 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.53 2004/01/04 19:39:46 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.54 2004/01/05 16:21:14 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -432,6 +432,18 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct mrt_config *conf) else reconfig = 1; break; + case IMSG_CTL_FIB_COUPLE: + if (idx != PFD_PIPE_SESSION) + logit(LOG_CRIT, "couple request not from SE"); + else + kroute_fib_couple(); + break; + case IMSG_CTL_FIB_DECOUPLE: + if (idx != PFD_PIPE_SESSION) + logit(LOG_CRIT, "decouple request not from SE"); + else + kroute_fib_decouple(); + break; default: break; } diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 0037e2ba3b4..56583a8a33f 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.52 2004/01/04 19:39:46 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.53 2004/01/05 16:21:14 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -180,7 +180,9 @@ enum imsg_type { IMSG_NEXTHOP_UPDATE, IMSG_CTL_SHOW_NEIGHBOR, IMSG_CTL_END, - IMSG_CTL_RELOAD + IMSG_CTL_RELOAD, + IMSG_CTL_FIB_COUPLE, + IMSG_CTL_FIB_DECOUPLE }; struct imsg_hdr { diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c index 33c3472dab8..8620c48ca5d 100644 --- a/usr.sbin/bgpd/control.c +++ b/usr.sbin/bgpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.9 2004/01/04 19:39:46 henning Exp $ */ +/* $OpenBSD: control.c,v 1.10 2004/01/05 16:21:14 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -212,7 +212,9 @@ control_dispatch_msg(struct pollfd *pfd, int i) imsg_compose(&c->ibuf, IMSG_CTL_END, 0, NULL, 0); break; case IMSG_CTL_RELOAD: - imsg_compose_parent(IMSG_CTL_RELOAD, 0, NULL, 0); + case IMSG_CTL_FIB_COUPLE: + case IMSG_CTL_FIB_DECOUPLE: + imsg_compose_parent(imsg.hdr.type, 0, NULL, 0); break; default: break; |