summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpyr <pyr@openbsd.org>2007-11-14 11:01:52 +0000
committerpyr <pyr@openbsd.org>2007-11-14 11:01:52 +0000
commit1f38f44cd8742c0ebbd91c256e1a19aa748724e8 (patch)
tree1c5b5e63097c06523b9be72b8c07b2a87d7b7c2a /usr.sbin
parentmake protos dynamic too (diff)
downloadwireguard-openbsd-1f38f44cd8742c0ebbd91c256e1a19aa748724e8.tar.xz
wireguard-openbsd-1f38f44cd8742c0ebbd91c256e1a19aa748724e8.zip
add some sanity, that will be useful later on.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/hoststated/hoststated.c8
-rw-r--r--usr.sbin/relayd/relayd.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/hoststated/hoststated.c b/usr.sbin/hoststated/hoststated.c
index f158b786863..12a3a5c32c0 100644
--- a/usr.sbin/hoststated/hoststated.c
+++ b/usr.sbin/hoststated/hoststated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hoststated.c,v 1.49 2007/11/14 10:59:01 pyr Exp $ */
+/* $OpenBSD: hoststated.c,v 1.50 2007/11/14 11:01:52 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -367,6 +367,8 @@ merge_config(struct hoststated *env, struct hoststated *new_env)
env->tables = new_env->tables;
env->services = new_env->services;
+ env->relays = new_env->relays;
+ env->protos = new_env->protos;
}
@@ -490,12 +492,13 @@ purge_config(struct hoststated *env, u_int8_t what)
free(rly);
}
free(env->relays);
+ env->relays = NULL;
}
if (what & PURGE_PROTOS && env->protos != NULL) {
while ((proto = TAILQ_FIRST(env->protos)) != NULL) {
TAILQ_REMOVE(env->protos, proto, entry);
- if (proto == &env->proto_default)
+ if (strcmp(proto->name, "default") == 0)
continue;
while ((pnode = RB_ROOT(&proto->request_tree))
!= NULL) {
@@ -520,6 +523,7 @@ purge_config(struct hoststated *env, u_int8_t what)
free(proto);
}
free(env->protos);
+ env->protos = NULL;
}
}
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index b0279d390b3..13a53393b17 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.49 2007/11/14 10:59:01 pyr Exp $ */
+/* $OpenBSD: relayd.c,v 1.50 2007/11/14 11:01:52 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -367,6 +367,8 @@ merge_config(struct hoststated *env, struct hoststated *new_env)
env->tables = new_env->tables;
env->services = new_env->services;
+ env->relays = new_env->relays;
+ env->protos = new_env->protos;
}
@@ -490,12 +492,13 @@ purge_config(struct hoststated *env, u_int8_t what)
free(rly);
}
free(env->relays);
+ env->relays = NULL;
}
if (what & PURGE_PROTOS && env->protos != NULL) {
while ((proto = TAILQ_FIRST(env->protos)) != NULL) {
TAILQ_REMOVE(env->protos, proto, entry);
- if (proto == &env->proto_default)
+ if (strcmp(proto->name, "default") == 0)
continue;
while ((pnode = RB_ROOT(&proto->request_tree))
!= NULL) {
@@ -520,6 +523,7 @@ purge_config(struct hoststated *env, u_int8_t what)
free(proto);
}
free(env->protos);
+ env->protos = NULL;
}
}