From fceea562fea9903d29220ff9e61ca5372a529006 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 26 Jan 2012 21:23:50 +0000 Subject: [PATCH] -fix mask calculation --- src/vpn/gnunet-service-vpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 58c7f5257..fbfd6e7f5 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c @@ -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 */ -- 2.25.1