diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-11-14 11:01:53 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-11-14 11:01:53 +0000 |
commit | 38779f39b59f9a26453e645b156200da5972a779 (patch) | |
tree | 1dc3d56b61f4947019618a44ba5e1fc71904abab /usr.sbin | |
parent | c0e74004feb6a3713eb241fb02211f7fa4b93360 (diff) |
add some sanity, that will be useful later on.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/hoststated/hoststated.c | 8 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.c | 8 |
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; } } |