summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpyr <pyr@openbsd.org>2007-05-31 18:20:03 +0000
committerpyr <pyr@openbsd.org>2007-05-31 18:20:03 +0000
commita518a4b91aea87eab1e31828fa0f342bf5e4251b (patch)
tree7d498d2912da5e8d34c828e813f73b26707aa2c6
parentadd an interface for work queues run from a kernel thread. (diff)
downloadwireguard-openbsd-a518a4b91aea87eab1e31828fa0f342bf5e4251b.tar.xz
wireguard-openbsd-a518a4b91aea87eab1e31828fa0f342bf5e4251b.zip
make sure object ids are reset before parsing the configuration file
again.
-rw-r--r--usr.sbin/hoststated/parse.y5
-rw-r--r--usr.sbin/relayd/parse.y5
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y
index fbd38880e21..d8e83e9a49e 100644
--- a/usr.sbin/hoststated/parse.y
+++ b/usr.sbin/hoststated/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.47 2007/05/31 03:24:05 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.48 2007/05/31 18:20:03 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -1416,6 +1416,9 @@ parse_config(const char *filename, int opts)
(conf->services = calloc(1, sizeof(*conf->services))) == NULL)
return (NULL);
+ last_host_id = last_table_id = last_service_id = last_proto_id =
+ last_relay_id = 0;
+
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 fbd38880e21..d8e83e9a49e 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.47 2007/05/31 03:24:05 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.48 2007/05/31 18:20:03 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -1416,6 +1416,9 @@ parse_config(const char *filename, int opts)
(conf->services = calloc(1, sizeof(*conf->services))) == NULL)
return (NULL);
+ last_host_id = last_table_id = last_service_id = last_proto_id =
+ last_relay_id = 0;
+
TAILQ_INIT(conf->services);
TAILQ_INIT(conf->tables);
TAILQ_INIT(&conf->protos);