diff options
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 11 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.c | 40 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 4 |
3 files changed, 12 insertions, 43 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 3240a9ddea6..97cd853048d 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.88 2004/03/16 12:06:43 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.89 2004/04/25 17:34:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -192,8 +192,7 @@ main(int argc, char *argv[]) fatal("fcntl"); /* fork children */ - rde_pid = rde_main(&conf, peer_l, &net_l, rules_l, &mrt_l, - pipe_m2r, pipe_s2r); + rde_pid = rde_main(&conf, &net_l, rules_l, &mrt_l, pipe_m2r, pipe_s2r); io_pid = session_main(&conf, peer_l, &net_l, rules_l, &mrt_l, pipe_m2s, pipe_s2r); @@ -379,14 +378,10 @@ reconfigure(char *conffile, struct bgpd_config *conf, struct mrt_head *mrt_l, if (imsg_compose(&ibuf_rde, IMSG_RECONF_CONF, 0, conf, sizeof(struct bgpd_config)) == -1) return (-1); - for (p = *peer_l; p != NULL; p = p->next) { + for (p = *peer_l; p != NULL; p = p->next) if (imsg_compose(&ibuf_se, IMSG_RECONF_PEER, p->conf.id, &p->conf, sizeof(struct peer_config)) == -1) return (-1); - if (imsg_compose(&ibuf_rde, IMSG_RECONF_PEER, p->conf.id, - &p->conf, sizeof(struct peer_config)) == -1) - return (-1); - } while ((n = TAILQ_FIRST(&net_l)) != NULL) { if (imsg_compose(&ibuf_rde, IMSG_RECONF_NETWORK, 0, &n->net, sizeof(struct network_config)) == -1) diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index b4231f78a88..52be39ccf6b 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.103 2004/04/25 07:16:24 henning Exp $ */ +/* $OpenBSD: rde.c,v 1.104 2004/04/25 17:34:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -56,7 +56,7 @@ void rde_update_log(const char *, const struct bgpd_addr *, u_int8_t); void rde_update_queue_runner(void); -void peer_init(struct peer *, u_int32_t); +void peer_init(u_int32_t); void peer_shutdown(void); struct rde_peer *peer_add(u_int32_t, struct peer_config *); void peer_remove(struct rde_peer *); @@ -94,9 +94,9 @@ u_int32_t pathhashsize = 1024; u_int32_t nexthophashsize = 64; int -rde_main(struct bgpd_config *config, struct peer *peer_l, - struct network_head *net_l, struct filter_head *rules, - struct mrt_head *mrt_l, int pipe_m2r[2], int pipe_s2r[2]) +rde_main(struct bgpd_config *config, struct network_head *net_l, + struct filter_head *rules, struct mrt_head *mrt_l, + int pipe_m2r[2], int pipe_s2r[2]) { pid_t pid; struct passwd *pw; @@ -153,7 +153,7 @@ rde_main(struct bgpd_config *config, struct peer *peer_l, pt_init(); path_init(pathhashsize); nexthop_init(nexthophashsize); - peer_init(peer_l, peerhashsize); + peer_init(peerhashsize); rules_l = rules; network_init(net_l); @@ -281,8 +281,6 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) { struct imsg imsg; struct mrt_config mrt; - struct peer_config *pconf; - struct rde_peer *p, *np; struct filter_rule *r; int n; @@ -309,15 +307,6 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) fatal(NULL); memcpy(nconf, imsg.data, sizeof(struct bgpd_config)); break; - case IMSG_RECONF_PEER: - pconf = imsg.data; - if ((p = peer_get(pconf->id)) == NULL) - p = peer_add(pconf->id, pconf); - else - memcpy(&p->conf, pconf, - sizeof(struct peer_config)); - p->conf.reconf_action = RECONF_KEEP; - break; case IMSG_RECONF_NETWORK: network_add(imsg.data); break; @@ -333,21 +322,6 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) case IMSG_RECONF_DONE: if (nconf == NULL) fatalx("got IMSG_RECONF_DONE but no config"); - for (p = LIST_FIRST(&peerlist); - p != NULL; p = np) { - np = LIST_NEXT(p, peer_l); - switch (p->conf.reconf_action) { - case RECONF_NONE: - peer_remove(p); - break; - case RECONF_KEEP: - /* reset state */ - p->conf.reconf_action = RECONF_NONE; - break; - default: - break; - } - } if ((nconf->flags & BGPD_FLAG_NO_EVALUATE) != (conf->flags & BGPD_FLAG_NO_EVALUATE)) { log_warnx( "change to/from route-collector " @@ -930,7 +904,7 @@ struct peer_table { &peertable.peer_hashtbl[(x) & peertable.peer_hashmask] void -peer_init(struct peer *peer_l, u_int32_t hashsize) +peer_init(u_int32_t hashsize) { u_int32_t hs, i; diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 0b0dabb296e..d464373baaf 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.42 2004/04/16 04:52:26 henning Exp $ */ +/* $OpenBSD: session.h,v 1.43 2004/04/25 17:34:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -197,7 +197,7 @@ int merge_config(struct bgpd_config *, struct bgpd_config *, struct peer *); /* rde.c */ -int rde_main(struct bgpd_config *, struct peer *, struct network_head *, +int rde_main(struct bgpd_config *, struct network_head *, struct filter_head *, struct mrt_head *, int[2], int[2]); /* control.c */ |