aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-06-15 07:15:34 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-06-15 07:15:34 +0000
commit331582ad4f7b929515171b67b1b011fbd3b70265 (patch)
tree0d230a90aa9c7c36211ed945af3b00bcbdb99ce3 /src/vpn
parent728fb46aebbf873afd67433c6abb5e6375d0c535 (diff)
downloadgnunet-331582ad4f7b929515171b67b1b011fbd3b70265.tar.gz
gnunet-331582ad4f7b929515171b67b1b011fbd3b70265.zip
better portability
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-exit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c
index 8abfdc31f..2f8ce774b 100644
--- a/src/vpn/gnunet-daemon-exit.c
+++ b/src/vpn/gnunet-daemon-exit.c
@@ -209,13 +209,14 @@ static void
209hash_redirect_info(GNUNET_HashCode* hash, struct redirect_info* u_i, size_t addrlen) 209hash_redirect_info(GNUNET_HashCode* hash, struct redirect_info* u_i, size_t addrlen)
210{ 210{
211 211
212 /* the gnunet hashmap only uses the first 32bit of the hash 212 /* the gnunet hashmap only uses the first sizeof(unsigned int) of the hash
213 * 213 *
214 * build the hash out of the last two bytes of the address and the 2 bytes of 214 * build the hash out of the last bytes of the address and the 2 bytes of
215 * the port 215 * the port
216 */ 216 */
217 memcpy(&hash, &u_i->pt, sizeof(u_i->pt)); 217 memcpy(hash, &u_i->pt, sizeof(u_i->pt));
218 memcpy(((unsigned char*)&hash)+2, u_i->addr+(addrlen-2), 2); 218 memcpy(((unsigned char*)hash)+2, u_i->addr+(addrlen-(sizeof(unsigned int) - 2)), (sizeof(unsigned int) - 2));
219 memset(((unsigned char*)hash)+sizeof(unsigned int), 0, sizeof(GNUNET_HashCode) - sizeof(unsigned int));
219} 220}
220 221
221/** 222/**