summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.c
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-10-19 14:15:15 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-10-19 14:15:15 +0000
commit5dadb529d1957791b0125d38afebaeb53427fb8d (patch)
tree801e57fed074112458c77c12c8050255c41a44b2 /usr.sbin/relayd/relayd.c
parent1919128b52ab85cdce80c42468da3dd2c2e24cc8 (diff)
Move relays from static TAILQs to allocated ones.
This syncs it with other hoststated entities and will make reload easier. This is step 1 out of 7 for reload.
Diffstat (limited to 'usr.sbin/relayd/relayd.c')
-rw-r--r--usr.sbin/relayd/relayd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index 6411a042a5b..8b56d93f6c0 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.44 2007/10/12 12:50:59 blambert Exp $ */
+/* $OpenBSD: relayd.c,v 1.45 2007/10/19 14:15:14 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -471,8 +471,8 @@ purge_config(struct hoststated *env, u_int8_t what)
}
if (what & PURGE_RELAYS) {
- while ((rly = TAILQ_FIRST(&env->relays)) != NULL) {
- TAILQ_REMOVE(&env->relays, rly, entry);
+ while ((rly = TAILQ_FIRST(env->relays)) != NULL) {
+ TAILQ_REMOVE(env->relays, rly, entry);
while ((sess = SPLAY_ROOT(&rly->sessions)) != NULL) {
SPLAY_REMOVE(session_tree,
&rly->sessions, sess);
@@ -486,6 +486,7 @@ purge_config(struct hoststated *env, u_int8_t what)
SSL_CTX_free(rly->ssl_ctx);
free(rly);
}
+ free(env->relays);
}
if (what & PURGE_PROTOS) {
@@ -733,7 +734,7 @@ relay_find(struct hoststated *env, objid_t id)
{
struct relay *rlay;
- TAILQ_FOREACH(rlay, &env->relays, entry)
+ TAILQ_FOREACH(rlay, env->relays, entry)
if (rlay->conf.id == id)
return (rlay);
return (NULL);
@@ -745,7 +746,7 @@ session_find(struct hoststated *env, objid_t id)
struct relay *rlay;
struct session *con;
- TAILQ_FOREACH(rlay, &env->relays, entry)
+ TAILQ_FOREACH(rlay, env->relays, entry)
SPLAY_FOREACH(con, session_tree, &rlay->sessions)
if (con->id == id)
return (con);
@@ -792,7 +793,7 @@ relay_findbyname(struct hoststated *env, const char *name)
{
struct relay *rlay;
- TAILQ_FOREACH(rlay, &env->relays, entry)
+ TAILQ_FOREACH(rlay, env->relays, entry)
if (strcmp(rlay->conf.name, name) == 0)
return (rlay);
return (NULL);