summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-07-04 03:37:04 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-07-04 03:37:04 +0000
commit8a66a965f7ea065f86f9f74241ba8cb602a8fde6 (patch)
tree2e5ee3ad868ba4ea6b44ed8c27dff12ab0014d1e
parentc3f7f0f8a79c464688c48b7f2cab68d451acb711 (diff)
when getting rid of the listen_addr TAILQ after forking actually close
the file descriptors in RDE and parent process, not needed or used there
-rw-r--r--usr.sbin/bgpd/bgpd.c3
-rw-r--r--usr.sbin/bgpd/rde.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 01ff6cd1a42..92da4dee163 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.98 2004/07/03 17:19:59 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.99 2004/07/04 03:37:03 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -233,6 +233,7 @@ main(int argc, char *argv[])
while ((la = TAILQ_FIRST(conf.listen_addrs)) != NULL) {
TAILQ_REMOVE(conf.listen_addrs, la, entry);
+ close(la->fd);
free(la);
}
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 0a0abd969a1..9eaa4e613ad 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.122 2004/07/03 17:19:59 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.123 2004/07/04 03:37:03 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -162,6 +162,7 @@ rde_main(struct bgpd_config *config, struct network_head *net_l,
while ((la = TAILQ_FIRST(config->listen_addrs)) != NULL) {
TAILQ_REMOVE(config->listen_addrs, la, entry);
+ close(la->fd);
free(la);
}
free(config->listen_addrs);