Patchwork [RFC,4/4] netfilter: ip6t_NPT: Do not mix two prefixes.

login
register
mail settings
Submitter YOSHIFUJI Hideaki / 吉藤英明
Date Jan. 26, 2013, 6:38 p.m.
Message ID <510422B4.8020204@linux-ipv6.org>
Download mbox | patch
Permalink /patch/215925/
State Accepted
Headers show

Comments

YOSHIFUJI Hideaki / 吉藤英明 - Jan. 26, 2013, 6:38 p.m.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 net/ipv6/netfilter/ip6t_NPT.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Pablo Neira - Feb. 7, 2013, 6:15 p.m.
Also applied.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv6/netfilter/ip6t_NPT.c b/net/ipv6/netfilter/ip6t_NPT.c
index 7d23d22..74e171d 100644
--- a/net/ipv6/netfilter/ip6t_NPT.c
+++ b/net/ipv6/netfilter/ip6t_NPT.c
@@ -56,7 +56,7 @@  static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt,
 
 		idx = i / 32;
 		addr->s6_addr32[idx] &= mask;
-		addr->s6_addr32[idx] |= npt->dst_pfx.in6.s6_addr32[idx];
+		addr->s6_addr32[idx] |= ~mask & npt->dst_pfx.in6.s6_addr32[idx];
 	}
 
 	if (pfx_len <= 48)