diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-26 21:23:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-26 21:23:34 +0000 |
commit | b570462a0eac26174dce67a895e6cfcde98e75eb (patch) | |
tree | 1bbf8859f2b51e7779f4e41a09f38ce0da9e2c75 /src/exit | |
parent | 864ce2f83aa7f2fcb2dbed046554235992d6c3cc (diff) | |
download | gnunet-b570462a0eac26174dce67a895e6cfcde98e75eb.tar.gz gnunet-b570462a0eac26174dce67a895e6cfcde98e75eb.zip |
-fix address order and mask calculation
Diffstat (limited to 'src/exit')
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 7e3ee05df..f9fdd82c2 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -1152,7 +1152,7 @@ setup_fresh_address (int af, | |||
1152 | /* Given ABCD::/96, we want a mask of 'ABCD::FFFF:FFFF, | 1152 | /* Given ABCD::/96, we want a mask of 'ABCD::FFFF:FFFF, |
1153 | thus: */ | 1153 | thus: */ |
1154 | mask = addr; | 1154 | mask = addr; |
1155 | for (i=127;i>=128-ipv6prefix;i--) | 1155 | for (i=127;i>=ipv6prefix;i--) |
1156 | mask.s6_addr[i / 8] |= (1 << (i % 8)); | 1156 | mask.s6_addr[i / 8] |= (1 << (i % 8)); |
1157 | 1157 | ||
1158 | /* Pick random IPv6 address within the subnet, except 'addr' or 'mask' itself */ | 1158 | /* Pick random IPv6 address within the subnet, except 'addr' or 'mask' itself */ |
@@ -1393,9 +1393,9 @@ prepare_ipv6_packet (const void *payload, size_t payload_length, | |||
1393 | 1393 | ||
1394 | GNUNET_TUN_initialize_ipv6_header (pkt6, | 1394 | GNUNET_TUN_initialize_ipv6_header (pkt6, |
1395 | protocol, | 1395 | protocol, |
1396 | len, | 1396 | len, |
1397 | &dst_address->address.ipv6, | 1397 | &src_address->address.ipv6, |
1398 | &src_address->address.ipv6); | 1398 | &dst_address->address.ipv6); |
1399 | 1399 | ||
1400 | switch (protocol) | 1400 | switch (protocol) |
1401 | { | 1401 | { |