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 | |
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')
-rw-r--r-- | src/vpn/Makefile.am | 5 | ||||
-rw-r--r-- | src/vpn/gnunet-vpn.c | 13 | ||||
-rw-r--r-- | src/vpn/vpn_api.c | 6 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index c4581df6f..e22c0e2c3 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am | |||
@@ -40,7 +40,7 @@ bin_PROGRAMS = \ | |||
40 | 40 | ||
41 | if MINGW | 41 | if MINGW |
42 | gnunet_helper_vpn_LDFLAGS = \ | 42 | gnunet_helper_vpn_LDFLAGS = \ |
43 | -no-undefined -Wl,--export-all-symbols | 43 | -no-undefined -Wl,--export-all-symbols |
44 | 44 | ||
45 | gnunet_helper_vpn_LDADD = \ | 45 | gnunet_helper_vpn_LDADD = \ |
46 | -lsetupapi -lnewdev -lshell32 -liconv -lstdc++ \ | 46 | -lsetupapi -lnewdev -lshell32 -liconv -lstdc++ \ |
@@ -53,7 +53,7 @@ else | |||
53 | gnunet-helper-vpn.c | 53 | gnunet-helper-vpn.c |
54 | endif | 54 | endif |
55 | gnunet_service_vpn_SOURCES = \ | 55 | gnunet_service_vpn_SOURCES = \ |
56 | gnunet-service-vpn.c | 56 | gnunet-service-vpn.c |
57 | gnunet_service_vpn_LDADD = \ | 57 | gnunet_service_vpn_LDADD = \ |
58 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 58 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
59 | $(top_builddir)/src/tun/libgnunettun.la \ | 59 | $(top_builddir)/src/tun/libgnunettun.la \ |
@@ -68,6 +68,7 @@ gnunet_vpn_SOURCES = \ | |||
68 | gnunet-vpn.c | 68 | gnunet-vpn.c |
69 | gnunet_vpn_LDADD = \ | 69 | gnunet_vpn_LDADD = \ |
70 | $(top_builddir)/src/vpn/libgnunetvpn.la \ | 70 | $(top_builddir)/src/vpn/libgnunetvpn.la \ |
71 | $(top_builddir)/src/tun/libgnunettun.la \ | ||
71 | $(top_builddir)/src/util/libgnunetutil.la \ | 72 | $(top_builddir)/src/util/libgnunetutil.la \ |
72 | $(GN_LIBINTL) | 73 | $(GN_LIBINTL) |
73 | gnunet_vpn_DEPENDENCIES = \ | 74 | gnunet_vpn_DEPENDENCIES = \ |
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, |
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c index cf493cc52..95ef8c46d 100644 --- a/src/vpn/vpn_api.c +++ b/src/vpn/vpn_api.c | |||
@@ -120,7 +120,7 @@ struct GNUNET_VPN_RedirectionRequest | |||
120 | /** | 120 | /** |
121 | * For service redirection, service descriptor. | 121 | * For service redirection, service descriptor. |
122 | */ | 122 | */ |
123 | struct GNUNET_HashCode serv; | 123 | struct GNUNET_HashCode serv; |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * At what time should the created service mapping expire? | 126 | * At what time should the created service mapping expire? |
@@ -162,7 +162,7 @@ reconnect (struct GNUNET_VPN_Handle *vh); | |||
162 | /** | 162 | /** |
163 | * Function called when we receive a message from the VPN service. | 163 | * Function called when we receive a message from the VPN service. |
164 | * | 164 | * |
165 | * @param cls the 'struct GNUNET_VPN_Handle' | 165 | * @param cls the `struct GNUNET_VPN_Handle` |
166 | * @param msg message received, NULL on timeout or fatal error | 166 | * @param msg message received, NULL on timeout or fatal error |
167 | */ | 167 | */ |
168 | static void | 168 | static void |
@@ -475,7 +475,7 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, | |||
475 | return rr; | 475 | return rr; |
476 | } | 476 | } |
477 | 477 | ||
478 | 478 | ||
479 | /** | 479 | /** |
480 | * Tell the VPN that forwarding to the Internet via some exit node is | 480 | * Tell the VPN that forwarding to the Internet via some exit node is |
481 | * requested. Note that both UDP and TCP traffic will be forwarded, | 481 | * requested. Note that both UDP and TCP traffic will be forwarded, |