summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-19 20:20:59 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-19 20:20:59 +0000
commit8d0f3fcd81b09a4dfe42a2682e58824168df8516 (patch)
tree902d3b08c4cdda29a113e425fba76a94ba6b68a9 /usr.sbin
parent3ad4acb8de250ad70235f6d739a8fcb2cd937cd6 (diff)
conf->holdtime was not set to teh default value initially if no holdtime
was specified in teh config file. this was done correctly in the reconfiguration process... use a new function init_conf() to set defaults where needed; currently only holdtime, and call it both in the startup and the reconf case. ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/session.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 4aeac90694a..43e9a9e0d4b 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.8 2003/12/19 16:46:07 henning Exp $ */
+/* $OpenBSD: session.c,v 1.9 2003/12/19 20:20:58 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -49,6 +49,7 @@
void session_sighdlr(int);
int setup_listener(void);
+void init_conf(struct bgpd_config *);
void init_peers(void);
void bgp_fsm(struct peer *, enum session_events);
int timer_due(time_t);
@@ -172,6 +173,7 @@ session_main(struct bgpd_config *config, int pipe_m2s[2], int pipe_s2r[2])
s2r_sock = pipe_s2r[0];
close(pipe_m2s[0]);
close(pipe_s2r[1]);
+ init_conf(conf);
init_imsg_buf();
init_peers();
@@ -292,6 +294,13 @@ session_main(struct bgpd_config *config, int pipe_m2s[2], int pipe_s2r[2])
}
void
+init_conf(struct bgpd_config *c)
+{
+ if (!c->holdtime)
+ c->holdtime = INTERVAL_HOLD;
+}
+
+void
init_peers(void)
{
struct peer *p;
@@ -1261,10 +1270,9 @@ session_dispatch_imsg(int fd, int idx)
fatal("got IMSG_RECONF_DONE but no config", 0);
conf->as = nconf->as;
conf->holdtime = nconf->holdtime;
- if (!conf->holdtime)
- conf->holdtime = INTERVAL_HOLD;
conf->bgpid = nconf->bgpid;
conf->min_holdtime = nconf->min_holdtime;
+ init_conf(conf);
/* add new peers */
for (p = nconf->peers; p != NULL; p = next) {
next = p->next;