summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-01-07 01:15:55 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-01-07 01:15:55 +0000
commitd38975507c415470385ee1c501572ef0ca33800f (patch)
tree1108f6958d4e62ac14ebda482d27f2a77a247b11
parent64688a737bdbc72fd19c48004f378b13fb5e9815 (diff)
don't try to be smart after config reloads and try to detect wether
a session needs a reinit for the new conf to kick in. the logic is condemned to fail, and implicitly taking sessions down is BAD. after discussion with mickey@, ok claudio@
-rw-r--r--usr.sbin/bgpd/config.c29
-rw-r--r--usr.sbin/bgpd/session.c29
2 files changed, 6 insertions, 52 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c
index b2b4b45cbab..3e7e6aef8cf 100644
--- a/usr.sbin/bgpd/config.c
+++ b/usr.sbin/bgpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.16 2004/01/06 03:43:50 henning Exp $ */
+/* $OpenBSD: config.c,v 1.17 2004/01/07 01:15:54 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -38,7 +38,6 @@ int
merge_config(struct bgpd_config *xconf, struct bgpd_config *conf,
struct peer *peer_l)
{
- enum reconf_action reconf = RECONF_NONE;
struct peer *p;
/* merge conf (new) into xconf (old) */
@@ -46,14 +45,12 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf,
logit(LOG_CRIT, "configuration error: AS not given");
return (1);
}
- if (xconf->as != conf->as) {
+ if (xconf->as != conf->as)
xconf->as = conf->as;
- reconf = RECONF_REINIT;
- }
- if (conf->bgpid && xconf->bgpid != conf->bgpid) {
+
+ if (conf->bgpid && xconf->bgpid != conf->bgpid)
xconf->bgpid = conf->bgpid;
- reconf = RECONF_REINIT;
- }
+
if (!xconf->bgpid)
xconf->bgpid = get_bgpid();
@@ -72,28 +69,12 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf,
memcpy(&xconf->listen_addr, &conf->listen_addr,
sizeof(xconf->listen_addr));
- if ((xconf->flags & BGPD_FLAG_NO_FIB_UPDATE) !=
- (conf->flags & BGPD_FLAG_NO_FIB_UPDATE)) {
- if (!(conf->flags & BGPD_FLAG_NO_FIB_UPDATE))
- kroute_fib_couple();
- else
- kroute_fib_decouple();
- }
-
xconf->flags = conf->flags;
xconf->log = conf->log;
-
- /*
- * as we cannot get the negotiated holdtime in the main process,
- * the session engine needs to check it against the possibly new values
- * and decide on session reestablishment.
- */
-
xconf->holdtime = conf->holdtime;
xconf->min_holdtime = conf->min_holdtime;
for (p = peer_l; p != NULL; p = p->next) {
- p->conf.reconf_action = reconf;
p->conf.ebgp = (p->conf.remote_as != xconf->as);
if (!p->conf.id)
p->conf.id = get_id(p);
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 16521ae93f4..104cf5cc510 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.72 2004/01/06 23:14:58 henning Exp $ */
+/* $OpenBSD: session.c,v 1.73 2004/01/07 01:15:54 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1365,35 +1365,8 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx)
} else
reconf = RECONF_KEEP;
- if (bcmp(&p->conf.remote_addr, &pconf->remote_addr,
- sizeof(struct sockaddr_in)))
- reconf = RECONF_REINIT;
- if (bcmp(&p->conf.local_addr, &pconf->local_addr,
- sizeof(struct sockaddr_in)))
- reconf = RECONF_REINIT;
- if (p->conf.remote_as != pconf->remote_as)
- reconf = RECONF_REINIT;
- if (p->conf.distance != pconf->distance)
- reconf = RECONF_REINIT;
-
- if (p->state <= STATE_ACTIVE &&
- p->conf.passive && !pconf->passive)
- reconf = RECONF_REINIT;
-
memcpy(&p->conf, pconf, sizeof(struct peer_config));
p->conf.reconf_action = reconf;
- if (pconf->reconf_action > reconf)
- p->conf.reconf_action = pconf->reconf_action;
-
- if (p->state >= STATE_OPENSENT) {
- if (p->holdtime == conf->holdtime &&
- nconf->holdtime > conf->holdtime)
- p->conf.reconf_action = RECONF_REINIT;
- if (p->holdtime > nconf->holdtime)
- p->conf.reconf_action = RECONF_REINIT;
- if (p->holdtime < nconf->min_holdtime)
- p->conf.reconf_action = RECONF_REINIT;
- }
break;
case IMSG_RECONF_DONE:
if (idx != PFD_PIPE_MAIN)