diff options
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 10 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.c | 5 |
4 files changed, 13 insertions, 10 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index a821d60f70c..42b50fded7c 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.41 2003/12/26 21:40:40 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.42 2003/12/27 00:53:51 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -191,7 +191,7 @@ main(int argc, char *argv[]) imsg_init(&ibuf_se, pipe_m2s[0]); imsg_init(&ibuf_rde, pipe_m2r[0]); - if ((rfd = kroute_init()) == -1) + if ((rfd = kroute_init(!(conf.flags & BGPD_FLAG_NO_FIB_UPDATE))) == -1) quit = 1; while (quit == 0) { diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 22f429f11c7..fe69ea7b552 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.40 2003/12/26 20:52:14 jakob Exp $ */ +/* $OpenBSD: bgpd.h,v 1.41 2003/12/27 00:53:51 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -315,7 +315,7 @@ int rde_main(struct bgpd_config *, int[2], int[2]); int mrt_mergeconfig(struct mrt_config *, struct mrt_config *); /* kroute.c */ -int kroute_init(void); +int kroute_init(int); int kroute_change(int, struct kroute *); int kroute_delete(int, struct kroute *); void kroute_shutdown(int); diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index ee80339fa9b..1ddb6b70569 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.37 2003/12/27 00:17:26 henning Exp $ */ +/* $OpenBSD: kroute.c,v 1.38 2003/12/27 00:53:51 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -72,6 +72,7 @@ RB_GENERATE(knexthop_tree, knexthop_node, entry, knexthop_compare); u_int32_t rtseq = 1; pid_t pid; +int fib_sync; #define F_BGPD_INSERTED 0x0001 #define F_KERNEL 0x0002 @@ -79,10 +80,12 @@ pid_t pid; #define F_NEXTHOP 0x0008 int -kroute_init(void) +kroute_init(int fs) { int s, opt; + fib_sync = fs; + if ((s = socket(AF_ROUTE, SOCK_RAW, 0)) == -1) { log_err("kroute_init: socket"); return (-1); @@ -138,6 +141,9 @@ kroute_msg(int fd, int action, struct kroute *kroute) } r; ssize_t n; + if (!fib_sync) + return (0); + bzero(&r, sizeof(r)); r.hdr.rtm_msglen = sizeof(r); r.hdr.rtm_version = RTM_VERSION; diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index c300dc37a56..e8b1248f1db 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.38 2003/12/27 00:18:11 jakob Exp $ */ +/* $OpenBSD: rde.c,v 1.39 2003/12/27 00:53:51 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -548,9 +548,6 @@ rde_send_kroute(struct prefix *new, struct prefix *old) struct prefix *p; enum imsg_type type; - if (conf->flags & BGPD_FLAG_NO_FIB_UPDATE) - return; - if (old == NULL && new == NULL) return; |