summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/config.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-03-15 14:40:09 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-03-15 14:40:09 +0000
commitf112b9a6769601ba2436b5e14a7425300b3b0aa4 (patch)
tree4f55e9c085e1d7c4be465946c994e0f4ddfca601 /usr.sbin/bgpd/config.c
parent80b7ee28149fa704f8e234644549d15add3a7347 (diff)
remove listener if bind() fails. no point in having a defunct listener
in the list; causes issues with upcoming changes, spotted by Jason Ackley <jason@ackley.net>, claudio ok
Diffstat (limited to 'usr.sbin/bgpd/config.c')
-rw-r--r--usr.sbin/bgpd/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c
index fe52c4a4df4..9e7cabf33eb 100644
--- a/usr.sbin/bgpd/config.c
+++ b/usr.sbin/bgpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.40 2004/10/01 15:11:12 henning Exp $ */
+/* $OpenBSD: config.c,v 1.41 2005/03/15 14:40:08 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -276,7 +276,9 @@ prepare_listeners(struct bgpd_config *conf)
log_warn("cannot bind to %s",
log_sockaddr((struct sockaddr *)&la->sa));
close(la->fd);
- la->fd = -1;
+ TAILQ_REMOVE(conf->listen_addrs, la, entry);
+ free(la);
+ continue;
}
}
}