summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-08-07 17:59:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-08-07 17:59:03 +0000
commitcdfc50384a9ef03eb8dfb39fdf507ab4ded65b50 (patch)
treebcd436cffbb3043d444404a23fb04970df0b6cf2 /usr.sbin/relayd/parse.y
parent62adb95b6b578d9c1d3ee2e79e520476ec947b9e (diff)
Fix carp demotion on tables. For some reason the default values were
inherited from the table definition even though these values could not be changed there. While there fix a memory leak in a rather strange case. OK phessler, jsg, pyr, sthen, deraadt
Diffstat (limited to 'usr.sbin/relayd/parse.y')
-rw-r--r--usr.sbin/relayd/parse.y9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index 3f235081565..023bea5a37e 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.145 2010/08/03 18:42:41 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.146 2010/08/07 17:59:02 claudio Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -2610,8 +2610,10 @@ table_inherit(struct table *tb)
return (NULL);
}
(void)strlcpy(tb->conf.name, pname, sizeof(tb->conf.name));
- if ((oldtb = table_findbyconf(conf, tb)) != NULL)
+ if ((oldtb = table_findbyconf(conf, tb)) != NULL) {
+ purge_table(NULL, tb);
return (oldtb);
+ }
/* Create a new table */
tb->conf.id = ++last_table_id;
@@ -2624,9 +2626,6 @@ table_inherit(struct table *tb)
/* Inherit global table options */
bcopy(&dsttb->conf.timeout, &tb->conf.timeout, sizeof(struct timeval));
- tb->conf.skip_cnt = dsttb->conf.skip_cnt;
- strlcpy(tb->conf.demote_group, dsttb->conf.demote_group,
- sizeof(tb->conf.demote_group));
/* Copy the associated hosts */
TAILQ_INIT(&tb->hosts);