summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2005-08-22 09:48:06 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2005-08-22 09:48:06 +0000
commit0a3a49a4b78e58486f89185a6b123c9341dce2f1 (patch)
treef4e79ae39487fb991fc771daab48c028128c44dc
parent9a822a647e3c8bd7d03006dd3b67c3c93192b708 (diff)
fix rdr to bitmask replacement address pool. patch from Max Laier,
reported by Boris Polevoy, tested by Jean Debogue, ok henning@
-rw-r--r--sys/net/pf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 5551f492b0c..511cc49f6d9 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.500 2005/08/18 10:28:13 pascoe Exp $ */
+/* $OpenBSD: pf.c,v 1.501 2005/08/22 09:48:05 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2427,6 +2427,11 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction,
case PF_RDR: {
if (pf_map_addr(pd->af, r, saddr, naddr, NULL, sn))
return (NULL);
+ if ((r->rpool.opts & PF_POOL_TYPEMASK) ==
+ PF_POOL_BITMASK)
+ PF_POOLMASK(naddr, naddr,
+ &r->rpool.cur->addr.v.a.mask, daddr,
+ pd->af);
if (r->rpool.proxy_port[1]) {
u_int32_t tmp_nport;