diff options
author | 2010-03-24 16:29:37 +0000 | |
---|---|---|
committer | 2010-03-24 16:29:37 +0000 | |
commit | 95a1f8c273d9bd5b6bceeb671451dfd66ffcd0cf (patch) | |
tree | c16323e38b33ef74fab1b195b75e670d37f4878b | |
parent | Modify example not to use an assignment in the if statement. We shouldn't (diff) | |
download | wireguard-openbsd-95a1f8c273d9bd5b6bceeb671451dfd66ffcd0cf.tar.xz wireguard-openbsd-95a1f8c273d9bd5b6bceeb671451dfd66ffcd0cf.zip |
DSR got broken with the move towards the new pf.
This fixes it.
Found out by Laurent Lavaud & myself.
"looks olrite" henning@
-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\"", |