From cfdb0e0818a05c2f7d0f84e27b05436d8e46a169 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Fri, 16 May 2008 14:47:59 +0000 Subject: 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 , ok reyk@ --- usr.sbin/relayd/pfe_filter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr.sbin/relayd') 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 @@ -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", -- cgit v1.2.3