diff options
author | 2005-08-22 09:48:05 +0000 | |
---|---|---|
committer | 2005-08-22 09:48:05 +0000 | |
commit | 12e0d799bafad9e48120f5bdeed5b99473c8732b (patch) | |
tree | 0bf92abeca831c32d0a8e4903334a0f49dd3c633 | |
parent | add the correct entry for newly added files. (diff) | |
download | wireguard-openbsd-12e0d799bafad9e48120f5bdeed5b99473c8732b.tar.xz wireguard-openbsd-12e0d799bafad9e48120f5bdeed5b99473c8732b.zip |
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.c | 7 |
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; |