diff options
author | 2007-11-14 11:01:52 +0000 | |
---|---|---|
committer | 2007-11-14 11:01:52 +0000 | |
commit | 1f38f44cd8742c0ebbd91c256e1a19aa748724e8 (patch) | |
tree | 1c5b5e63097c06523b9be72b8c07b2a87d7b7c2a /usr.sbin/hoststated | |
parent | make protos dynamic too (diff) | |
download | wireguard-openbsd-1f38f44cd8742c0ebbd91c256e1a19aa748724e8.tar.xz wireguard-openbsd-1f38f44cd8742c0ebbd91c256e1a19aa748724e8.zip |
add some sanity, that will be useful later on.
Diffstat (limited to 'usr.sbin/hoststated')
-rw-r--r-- | usr.sbin/hoststated/hoststated.c | 8 |
1 files changed, 6 insertions, 2 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; } } |