diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2010-03-24 16:29:38 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2010-03-24 16:29:38 +0000 |
commit | 33296c688e60a750144592ca83bd2c79889dd9d2 (patch) | |
tree | 13de76aab59a6be1c76cddccd2b5346640af2845 /usr.sbin | |
parent | 6f72d38170d645f9e98533a149f45f15646d34e2 (diff) |
DSR got broken with the move towards the new pf.
This fixes it.
Found out by Laurent Lavaud & myself.
"looks olrite" henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/relayd/pfe_filter.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/relayd/pfe_filter.c b/usr.sbin/relayd/pfe_filter.c index d303d1fa7a8..56bc94cb6e9 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.42 2010/01/12 23:27:23 dlg Exp $ */ +/* $OpenBSD: pfe_filter.c,v 1.43 2010/03/24 16:29:37 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -476,6 +476,12 @@ sync_ruleset(struct relayd *env, struct rdr *rdr, int enable) if (rdr->conf.flags & F_STICKY) rio.rule.rdr.opts |= PF_POOL_STICKYADDR; + if (rio.rule.rt == PF_ROUTETO) { + memcpy(&rio.rule.route, &rio.rule.rdr, + sizeof(rio.rule.route)); + rio.rule.rdr.addr.type = PF_ADDR_NONE; + } + if (ioctl(env->sc_pf->dev, DIOCADDRULE, &rio) == -1) fatal("cannot add rule"); log_debug("sync_ruleset: rule added to anchor \"%s\"", |