diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-03 20:22:08 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-03 20:22:08 +0000 |
commit | 0d646af6fcf80c9805a79148a17f823044cd631a (patch) | |
tree | 367167b33828ec0bb6237ee2673bb3b95c594209 /usr.sbin/bgpd/config.c | |
parent | b6338aa67f31a3cf25e732e87e7cec751a6c651c (diff) |
decouple the peer list from bgpd_config.
so many parts of bgpd are not at all interested in the session specific peer
structs... allows for some further cleaning
Diffstat (limited to 'usr.sbin/bgpd/config.c')
-rw-r--r-- | usr.sbin/bgpd/config.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index e4ae55b9f4e..6fa0cdcdc45 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.13 2004/01/02 22:47:33 itojun Exp $ */ +/* $OpenBSD: config.c,v 1.14 2004/01/03 20:22:07 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -34,10 +34,11 @@ u_int32_t get_bgpid(void); u_int32_t get_id(struct peer *); int -merge_config(struct bgpd_config *xconf, struct bgpd_config *conf) +merge_config(struct bgpd_config *xconf, struct bgpd_config *conf, + struct peer *peers) { enum reconf_action reconf = RECONF_NONE; - struct peer *p, *next; + struct peer *p; /* merge conf (new) into xconf (old) */ if (!conf->as) { @@ -90,21 +91,13 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf) xconf->holdtime = conf->holdtime; xconf->min_holdtime = conf->min_holdtime; - for (p = conf->peers; p != NULL; p = p->next) { + for (p = peers; 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); } - for (p = xconf->peers; p != NULL; p = next) { - next = p->next; - free(p); - } - - /* merge peers done by session engine except for initial config */ - xconf->peers = conf->peers; - return (0); } |