summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2008-05-16 14:47:59 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2008-05-16 14:47:59 +0000
commitcfdb0e0818a05c2f7d0f84e27b05436d8e46a169 (patch)
tree55f7d684e5d03f2bc723b8b8847f37f09c880a08 /usr.sbin/relayd
parent6551b450ddb66727e4efb13a70e0741746a88bab (diff)
Clear source nodes on table changes in sticky mode. This has the
disadvantage of removing valid src nodes, but the advantage of not sending out traffic to hosts that are not up anymore. From a diff by <mkoc@prime.pl>, ok reyk@
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/pfe_filter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/relayd/pfe_filter.c b/usr.sbin/relayd/pfe_filter.c
index 81d0444510d..6a4033dd2df 100644
--- a/usr.sbin/relayd/pfe_filter.c
+++ b/usr.sbin/relayd/pfe_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfe_filter.c,v 1.26 2008/05/07 01:49:29 reyk Exp $ */
+/* $OpenBSD: pfe_filter.c,v 1.27 2008/05/16 14:47:58 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -224,7 +224,11 @@ sync_table(struct relayd *env, struct rdr *rdr, struct table *table)
if (ioctl(env->sc_pf->dev, DIOCRSETADDRS, &io) == -1)
fatal("sync_table: cannot set address list");
-
+ if (rdr->conf.flags & F_STICKY) {
+ if (ioctl(env->sc_pf->dev, DIOCCLRSRCNODES, 0) == -1)
+ fatal("sync_table: cannot clear the tree of "
+ "source tracking nodes");
+ }
free(addlist);
log_debug("sync_table: table %s: %d added, %d deleted, %d changed",