summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2012-10-03 08:33:32 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2012-10-03 08:33:32 +0000
commita8234f985edd9f56dbf70928fb8c3bd3a14f85e7 (patch)
tree6d25f1fae52e7306b20c95f07d55d541e43784c8 /usr.sbin/relayd/relayd.c
parent942d992468ce9d3e26af160fe7cac759163268bd (diff)
Support more than one relay backup table. Instead of duplicating the
code for main and backup table all over the place, turn the relay tables into a list attached to the relay. This improves the code and allows some other tricks with multiple tables later.
Diffstat (limited to 'usr.sbin/relayd/relayd.c')
-rw-r--r--usr.sbin/relayd/relayd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index e8c2c5aba1f..ccc37788912 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.109 2012/09/21 09:56:27 benno Exp $ */
+/* $OpenBSD: relayd.c,v 1.110 2012/10/03 08:33:31 reyk Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -564,6 +564,7 @@ void
purge_relay(struct relayd *env, struct relay *rlay)
{
struct rsession *con;
+ struct relay_table *rlt;
/* shutdown and remove relay */
if (event_initialized(&rlay->rl_ev))
@@ -591,6 +592,11 @@ purge_relay(struct relayd *env, struct relay *rlay)
if (rlay->rl_ssl_ca != NULL)
free(rlay->rl_ssl_ca);
+ while ((rlt = TAILQ_FIRST(&rlay->rl_tables))) {
+ TAILQ_REMOVE(&rlay->rl_tables, rlt, rlt_entry);
+ free(rlt);
+ }
+
free(rlay);
}