diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2009-04-17 09:47:07 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2009-04-17 09:47:07 +0000 |
commit | 0e6da7e0fe2efb9f3f3cd1483f7a65e6649dc98f (patch) | |
tree | 5aff6fef95469bfcb7de3f03036fb35c08054dc3 /usr.sbin/relayd/hce.c | |
parent | 687e2e4ca736036c4cc5f86b7d3df7e11e6ffb89 (diff) |
keep the parent relations of hosts after reloading the configuration.
From Camiel Dobbelaar, closes PR 6066
Diffstat (limited to 'usr.sbin/relayd/hce.c')
-rw-r--r-- | usr.sbin/relayd/hce.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c index 2f2dca574c6..d02134ac9a9 100644 --- a/usr.sbin/relayd/hce.c +++ b/usr.sbin/relayd/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.46 2008/12/05 16:37:55 reyk Exp $ */ +/* $OpenBSD: hce.c,v 1.47 2009/04/17 09:47:06 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -452,9 +452,8 @@ hce_dispatch_parent(int fd, short event, void * ptr) struct ctl_script scr; ssize_t n; size_t len; - static struct table *table = NULL; - struct host *host; + struct host *host, *parent; ibuf = ptr; switch (event) { @@ -525,6 +524,11 @@ hce_dispatch_parent(int fd, short event, void * ptr) memcpy(&host->conf, imsg.data, sizeof(host->conf)); host->tablename = table->conf.name; TAILQ_INSERT_TAIL(&table->hosts, host, entry); + if (host->conf.parentid) { + parent = host_find(env, host->conf.parentid); + SLIST_INSERT_HEAD(&parent->children, + host, child); + } break; case IMSG_RECONF_END: log_warnx("hce: configuration reloaded"); |