aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-26 21:23:50 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-26 21:23:50 +0000
commitfceea562fea9903d29220ff9e61ca5372a529006 (patch)
tree4ca7be9d583919f5f32b4032224039e2e2e62381 /src/vpn
parentb570462a0eac26174dce67a895e6cfcde98e75eb (diff)
downloadgnunet-fceea562fea9903d29220ff9e61ca5372a529006.tar.gz
gnunet-fceea562fea9903d29220ff9e61ca5372a529006.zip
-fix mask calculation
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-service-vpn.c2
1 files changed, 1 insertions, 1 deletions
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)
2377 /* Given ABCD::/96, we want a mask of 'ABCD::FFFF:FFFF, 2377 /* Given ABCD::/96, we want a mask of 'ABCD::FFFF:FFFF,
2378 thus: */ 2378 thus: */
2379 mask = addr; 2379 mask = addr;
2380 for (i=127;i>=128-ipv6prefix;i--) 2380 for (i=127;i>=ipv6prefix;i--)
2381 mask.s6_addr[i / 8] |= (1 << (i % 8)); 2381 mask.s6_addr[i / 8] |= (1 << (i % 8));
2382 2382
2383 /* Pick random IPv6 address within the subnet, except 'addr' or 'mask' itself */ 2383 /* Pick random IPv6 address within the subnet, except 'addr' or 'mask' itself */