6rd: Clear correct IPv6 address bits in 6rdcalc
[openwrt.git] / package / network / ipv6 / 6rd / src / 6rdcalc.c
index 56e07d255b70c6576bc17e282feb02880ad9a6a7..87bc397006bd937500c6d8ab738b1137db4fa137 100644 (file)
@@ -110,7 +110,7 @@ int main(int argc, const char **argv)
 
        /* Clear remaining bits. */
        while (v6it < 128) {
-               byte6 = (unsigned char *)(&v6.s6_addr) + (v6it >> 2);
+               byte6 = (unsigned char *)(&v6.s6_addr) + (v6it >> 3);
                bit6 = 128 >> (v6it & 0x07);
 
                *byte6 &= ~bit6;