]> git.hungrycats.org Git - linux/commitdiff
[IPV6] Fix ipv6_addr_prefix() for prefixlen != 0 (mod 8)
authorJean-Luc Richier <jean-luc.richier@imag.fr>
Thu, 10 Jul 2003 21:24:10 +0000 (07:24 +1000)
committerDavid S. Miller <davem@nuts.ninka.net>
Thu, 10 Jul 2003 21:24:10 +0000 (07:24 +1000)
include/net/ipv6.h

index 8c11fb6a03677d9849c65f6bff7279aa2dad3b4b..5c6546accda97dd30cf00b5440ef7dc10256c5e7 100644 (file)
@@ -276,8 +276,10 @@ static inline void ipv6_addr_prefix(struct in6_addr *pfx,
            b = plen & 0x7;
 
        memcpy(pfx->s6_addr, addr, o);
-       if (b != 0)
+       if (b != 0) {
                pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b);
+               o++;
+       }
        if (o < 16)
                memset(pfx->s6_addr + o, 0, 16 - o);
 }