diff options
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 5 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 12 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 5 |
3 files changed, 16 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 8cb2b376101..b3f94f52392 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.83 2004/03/10 14:45:24 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.84 2004/03/10 15:15:48 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -196,7 +196,8 @@ main(int argc, char *argv[]) /* fork children */ rde_pid = rde_main(&conf, peer_l, &net_l, rules_l, pipe_m2r, pipe_s2r); - io_pid = session_main(&conf, peer_l, rules_l, pipe_m2s, pipe_s2r); + io_pid = session_main(&conf, peer_l, &net_l, rules_l, pipe_m2s, + pipe_s2r); setproctitle("parent"); diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 9e9b64e4c0f..c099992f0d6 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.132 2004/03/10 14:54:11 henning Exp $ */ +/* $OpenBSD: session.c,v 1.133 2004/03/10 15:15:48 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -138,13 +138,15 @@ setup_listener(void) int session_main(struct bgpd_config *config, struct peer *cpeers, - struct filter_head *rules, int pipe_m2s[2], int pipe_s2r[2]) + struct network_head *net_l, struct filter_head *rules, + int pipe_m2s[2], int pipe_s2r[2]) { int nfds, i, j, timeout, idx_peers; pid_t pid; time_t nextaction; struct passwd *pw; struct peer *p, *peer_l[OPEN_MAX], *last, *next; + struct network *net; struct filter_rule *r; struct pollfd pfd[OPEN_MAX]; struct ctl_conn *ctl_conn; @@ -205,6 +207,12 @@ session_main(struct bgpd_config *config, struct peer *cpeers, } free(rules); + /* network list is not used in the SE */ + while ((net = TAILQ_FIRST(net_l)) != NULL) { + TAILQ_REMOVE(net_l, net, network_l); + free(net); + } + while (session_quit == 0) { bzero(&pfd, sizeof(pfd)); pfd[PFD_LISTEN].fd = sock; diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 9ab267941e4..df8bb83d4c4 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.36 2004/03/10 14:45:25 henning Exp $ */ +/* $OpenBSD: session.h,v 1.37 2004/03/10 15:15:48 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -171,7 +171,8 @@ struct peer *peers; /* session.c */ void session_socket_blockmode(int, enum blockmodes); int session_main(struct bgpd_config *, struct peer *, - struct filter_head *, int[2], int[2]); + struct network_head *, struct filter_head *, + int[2], int[2]); void bgp_fsm(struct peer *, enum session_events); struct peer *getpeerbyip(in_addr_t); int imsg_compose_parent(int, pid_t, void *, u_int16_t); |