diff options
-rw-r--r-- | ip6t_NPTV6_common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ip6t_NPTV6_common.h b/ip6t_NPTV6_common.h index 4a0c807..1559090 100644 --- a/ip6t_NPTV6_common.h +++ b/ip6t_NPTV6_common.h @@ -72,11 +72,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); } |