summaryrefslogtreecommitdiffstats
path: root/ip6t_NPTV6_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'ip6t_NPTV6_common.h')
-rw-r--r--ip6t_NPTV6_common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ip6t_NPTV6_common.h b/ip6t_NPTV6_common.h
index efb5aa5..c307c44 100644
--- a/ip6t_NPTV6_common.h
+++ b/ip6t_NPTV6_common.h
@@ -87,11 +87,11 @@ static bool translate_address(struct in6_addr *addr, const struct in6_addr *pref
}
if (b != 0) {
- u_int16_t bmask = 0xffff << (16-b);
+ u_int16_t bmask = htons(0xffff << (16-b));
csum = add16(csum, addr->s6_addr16[o] & bmask);
csum = add16(csum, ~(prefix->s6_addr16[o] & bmask));
- addr->s6_addr16[o] &= bmask;
+ addr->s6_addr16[o] &= ~bmask;
addr->s6_addr16[o] |= (prefix->s6_addr16[o] & bmask);
}