summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-07-20 15:00:14 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-07-20 15:00:14 +0000
commitac20646f75063a3e8ab7ab8b8a7365c4a3d6b4d8 (patch)
tree32e5322551209e883d1a27f11fe449affd07f415 /usr.sbin/bgpd/bgpd.c
parentee862f72ddbaf46e7ee152665ad00cf82bd4235f (diff)
On config reload errors free the list of ribs so that following reloads
don't fail because of redefinition conflicts. This problem was reported by some people.
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r--usr.sbin/bgpd/bgpd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 43e284b9336..048e0c3d5f0 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.148 2009/06/07 00:30:23 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.149 2009/07/20 15:00:13 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -464,6 +464,10 @@ reconfigure(char *conffile, struct bgpd_config *conf, struct mrt_head *mrt_l,
if (parse_config(conffile, conf, mrt_l, peer_l, &net_l, rules_l)) {
log_warnx("config file %s has errors, not reloading",
conffile);
+ while ((rr = SIMPLEQ_FIRST(&ribnames))) {
+ SIMPLEQ_REMOVE_HEAD(&ribnames, entry);
+ free(rr);
+ }
return (1);
}