diff options
author | 2015-03-14 02:32:35 +0000 | |
---|---|---|
committer | 2015-03-14 02:32:35 +0000 | |
commit | c1652e54911e2d572199d7eef5b4e313b652afb1 (patch) | |
tree | e6221cdd6b70970c345acd2b3613e184be06cf5c | |
parent | When removing interfaces in the RDE we also need to remove all the RDE (diff) | |
download | wireguard-openbsd-c1652e54911e2d572199d7eef5b4e313b652afb1.tar.xz wireguard-openbsd-c1652e54911e2d572199d7eef5b4e313b652afb1.zip |
Move the code that adjust FIB priority when changed during a config reload
from the parsing function to the merge_config function where it belongs.
OK henning@ benno@ before lock
-rw-r--r-- | usr.sbin/bgpd/config.c | 12 | ||||
-rw-r--r-- | usr.sbin/bgpd/parse.y | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index 9533e2f97d8..9859b04a470 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.58 2015/02/09 11:37:31 claudio Exp $ */ +/* $OpenBSD: config.c,v 1.59 2015/03/14 02:32:35 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -72,6 +72,16 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf, free(xconf->rcsock); conf->listen_addrs = xconf->listen_addrs; + + /* adjust FIB priority if changed */ + /* if xconf is uninitalized we get RTP_NONE */ + if (xconf->fib_priority != RTP_NONE && xconf->fib_priority != + conf->fib_priority) { + kr_fib_decouple_all(xconf->fib_priority); + kr_fib_update_prio_all(conf->fib_priority); + kr_fib_couple_all(conf->fib_priority); + } + memcpy(xconf, conf, sizeof(struct bgpd_config)); if (conf->listen_addrs == NULL) { diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index b793b466b40..8fb514a8802 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.275 2014/11/20 05:51:20 jsg Exp $ */ +/* $OpenBSD: parse.y,v 1.276 2015/03/14 02:32:35 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -2578,9 +2578,6 @@ parse_config(char *filename, struct bgpd_config *xconf, struct rde_rib *rr; struct rdomain *rd; int errors = 0; - u_int8_t old_prio; - - old_prio = xconf->fib_priority; if ((conf = calloc(1, sizeof(struct bgpd_config))) == NULL) fatal(NULL); @@ -2736,13 +2733,6 @@ parse_config(char *filename, struct bgpd_config *xconf, free(peerfilter_l); free(groupfilter_l); - if (!errors && old_prio != RTP_NONE && old_prio != - xconf->fib_priority) { - kr_fib_decouple_all(old_prio); - kr_fib_update_prio_all(xconf->fib_priority); - kr_fib_couple_all(xconf->fib_priority); - } - return (errors ? -1 : 0); } |