-fix mask calculation
authorChristian Grothoff <christian@grothoff.org>
Thu, 26 Jan 2012 21:23:50 +0000 (21:23 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 26 Jan 2012 21:23:50 +0000 (21:23 +0000)
src/vpn/gnunet-service-vpn.c

index 58c7f5257436bd6639b5bc9a53ad817306ee8608..fbfd6e7f5c960a688d8331b577f2cac9aaa41238 100644 (file)
@@ -2377,7 +2377,7 @@ allocate_v6_address (struct in6_addr *v6)
   /* Given ABCD::/96, we want a mask of 'ABCD::FFFF:FFFF,
      thus: */
   mask = addr;
-  for (i=127;i>=128-ipv6prefix;i--)
+  for (i=127;i>=ipv6prefix;i--)
     mask.s6_addr[i / 8] |= (1 << (i % 8));
   
   /* Pick random IPv6 address within the subnet, except 'addr' or 'mask' itself */