diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-20 15:26:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-20 15:26:03 +0000 |
commit | d544e81283a24082e6423c8f4377939f6fefa780 (patch) | |
tree | ab8aaf264cdd6d27853ff15a2f7542c801acf721 /src/vpn/gnunet-vpn.c | |
parent | a0a09022f0d0df917465b8e71753a69f066058d3 (diff) | |
download | gnunet-d544e81283a24082e6423c8f4377939f6fefa780.tar.gz gnunet-d544e81283a24082e6423c8f4377939f6fefa780.zip |
-use the same hash function to map service name to hash, not once strlen and then strlen+1
Diffstat (limited to 'src/vpn/gnunet-vpn.c')
-rw-r--r-- | src/vpn/gnunet-vpn.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c index a68fdc45b..d2e5eec4e 100644 --- a/src/vpn/gnunet-vpn.c +++ b/src/vpn/gnunet-vpn.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_tun_lib.h" | ||
29 | #include "gnunet_vpn_service.h" | 30 | #include "gnunet_vpn_service.h" |
30 | 31 | ||
31 | 32 | ||
@@ -227,16 +228,16 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
227 | protocol = IPPROTO_UDP; | 228 | protocol = IPPROTO_UDP; |
228 | if (GNUNET_OK != | 229 | if (GNUNET_OK != |
229 | GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, | 230 | GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, |
230 | strlen (peer_id), | 231 | strlen (peer_id), |
231 | &peer.public_key)) | 232 | &peer.public_key)) |
232 | { | 233 | { |
233 | FPRINTF (stderr, _("`%s' is not a valid peer identifier.\n"), | 234 | FPRINTF (stderr, |
235 | _("`%s' is not a valid peer identifier.\n"), | ||
234 | peer_id); | 236 | peer_id); |
235 | goto error; | 237 | goto error; |
236 | } | 238 | } |
237 | GNUNET_CRYPTO_hash (service_name, | 239 | GNUNET_TUN_service_name_to_hash (service_name, |
238 | strlen (service_name), | 240 | &sd); |
239 | &sd); | ||
240 | request = GNUNET_VPN_redirect_to_peer (handle, | 241 | request = GNUNET_VPN_redirect_to_peer (handle, |
241 | req_af, | 242 | req_af, |
242 | protocol, | 243 | protocol, |