提交 d4c38fa8 编写于 作者: Y YOSHIFUJI Hideaki / 吉藤英明 提交者: Pablo Neira Ayuso

netfilter: ip6t_NPT: Fix prefix mangling

Make sure only the bits that are part of the prefix are mangled.
Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 f5271fff
...@@ -51,7 +51,7 @@ static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt, ...@@ -51,7 +51,7 @@ static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt,
idx = i / 32; idx = i / 32;
addr->s6_addr32[idx] &= mask; 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) if (pfx_len <= 48)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册