summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-11-14 15:58:05 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-11-14 15:58:05 +0000
commitd17d7c78a5e03bf637f4a78d847170a7315ca4bf (patch)
tree1d6ba78e542d26b2af6caf99e300b91fc4fc538d /usr.sbin
parent2341a970dfd1f1edadd62ce65edab2e6ea2e5d41 (diff)
reset global variables everytime we enter parse_config.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/hoststated/parse.y8
-rw-r--r--usr.sbin/relayd/parse.y8
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y
index a35c9c94c0e..e2b1652ffad 100644
--- a/usr.sbin/hoststated/parse.y
+++ b/usr.sbin/hoststated/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.78 2007/11/14 10:59:01 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.79 2007/11/14 15:58:04 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1595,9 +1595,15 @@ parse_config(const char *filename, int opts)
return (NULL);
}
+ errors = 0;
last_host_id = last_table_id = last_service_id = last_proto_id =
last_relay_id = 0;
+ service = NULL;
+ table = NULL;
+ rlay = NULL;
+ proto = NULL;
+
TAILQ_INIT(conf->services);
TAILQ_INIT(conf->tables);
TAILQ_INIT(conf->protos);
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index a35c9c94c0e..e2b1652ffad 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.78 2007/11/14 10:59:01 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.79 2007/11/14 15:58:04 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1595,9 +1595,15 @@ parse_config(const char *filename, int opts)
return (NULL);
}
+ errors = 0;
last_host_id = last_table_id = last_service_id = last_proto_id =
last_relay_id = 0;
+ service = NULL;
+ table = NULL;
+ rlay = NULL;
+ proto = NULL;
+
TAILQ_INIT(conf->services);
TAILQ_INIT(conf->tables);
TAILQ_INIT(conf->protos);