diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-08-13 07:39:58 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-08-13 07:39:58 +0000 |
commit | b7ebe12cf05f367b97905d635d207436edb3c4fb (patch) | |
tree | ad8cb18c4bddb5215e5d345b08232b805296b001 /usr.sbin/bgpd | |
parent | 2068918a16d3873c7d21e43420f61147cdd28b7f (diff) |
When allocating a new peer set the reconf_action to RECONF_REINIT.
Also in merge_config() it is no longer needed to reset the reconf_action
of the new peers to RECONF_REINIT. merge_config() is not called on
startup and so some of the initialisation of new peers did not happen
correctly.
This fixes the md5 integration test since the md5 initialisation did not
happen early enough.
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/config.c | 5 | ||||
-rw-r--r-- | usr.sbin/bgpd/parse.y | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index 0d04a4ee333..026712ce4ef 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.91 2019/08/05 08:46:55 claudio Exp $ */ +/* $OpenBSD: config.c,v 1.92 2019/08/13 07:39:57 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -305,13 +305,10 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf) /* * merge peers: * - need to know which peers are new, replaced and removed - * - first mark all new peers as RECONF_REINIT * - walk over old peers and check if there is a corresponding new * peer if so mark it RECONF_KEEP. Remove all old peers. * - swap lists (old peer list is actually empty). */ - RB_FOREACH(p, peer_head, &conf->peers) - p->reconf_action = RECONF_REINIT; RB_FOREACH_SAFE(p, peer_head, &xconf->peers, nextp) { np = getpeerbyid(conf, p->conf.id); if (np != NULL) { diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 7832bba15b5..d872cc9c94a 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.400 2019/08/08 11:30:46 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.401 2019/08/13 07:39:57 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -3764,6 +3764,7 @@ alloc_peer(void) /* some sane defaults */ p->state = STATE_NONE; + p->reconf_action = RECONF_REINIT; p->conf.distance = 1; p->conf.export_type = EXPORT_UNSET; p->conf.announce_capa = 1; |