summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-03-10 15:15:49 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-03-10 15:15:49 +0000
commitca9bc431e47f19584636a3665e756a609163e145 (patch)
tree2d8b8326611a2a327f8c0e683eac14c863f3ba6c /usr.sbin/bgpd/session.c
parent853ecc4e3fcf1f0cf0ee328c9746559bfa50ca20 (diff)
pass a pointer to the network list as well to session_main so we can free()
the members after fork
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c12
1 files changed, 10 insertions, 2 deletions
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;