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) |
-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 c4581df6f5..e22c0e2c39 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am @@ -40,7 +40,7 @@ bin_PROGRAMS = \ if MINGW gnunet_helper_vpn_LDFLAGS = \ - -no-undefined -Wl,--export-all-symbols + -no-undefined -Wl,--export-all-symbols gnunet_helper_vpn_LDADD = \ -lsetupapi -lnewdev -lshell32 -liconv -lstdc++ \ @@ -53,7 +53,7 @@ else gnunet-helper-vpn.c endif gnunet_service_vpn_SOURCES = \ - gnunet-service-vpn.c + gnunet-service-vpn.c gnunet_service_vpn_LDADD = \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ $(top_builddir)/src/tun/libgnunettun.la \ @@ -68,6 +68,7 @@ gnunet_vpn_SOURCES = \ gnunet-vpn.c gnunet_vpn_LDADD = \ $(top_builddir)/src/vpn/libgnunetvpn.la \ + $(top_builddir)/src/tun/libgnunettun.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(GN_LIBINTL) gnunet_vpn_DEPENDENCIES = \ diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c index a68fdc45b7..d2e5eec4e2 100644 --- a/src/vpn/gnunet-vpn.c +++ b/src/vpn/gnunet-vpn.c @@ -26,6 +26,7 @@ #include "platform.h" #include "gnunet_util_lib.h" +#include "gnunet_tun_lib.h" #include "gnunet_vpn_service.h" @@ -227,16 +228,16 @@ run (void *cls, char *const *args, const char *cfgfile, protocol = IPPROTO_UDP; if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, - strlen (peer_id), - &peer.public_key)) + strlen (peer_id), + &peer.public_key)) { - FPRINTF (stderr, _("`%s' is not a valid peer identifier.\n"), + FPRINTF (stderr, + _("`%s' is not a valid peer identifier.\n"), peer_id); goto error; } - GNUNET_CRYPTO_hash (service_name, - strlen (service_name), - &sd); + GNUNET_TUN_service_name_to_hash (service_name, + &sd); request = GNUNET_VPN_redirect_to_peer (handle, req_af, protocol, diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c index cf493cc52c..95ef8c46da 100644 --- a/src/vpn/vpn_api.c +++ b/src/vpn/vpn_api.c @@ -120,7 +120,7 @@ struct GNUNET_VPN_RedirectionRequest /** * For service redirection, service descriptor. */ - struct GNUNET_HashCode serv; + struct GNUNET_HashCode serv; /** * At what time should the created service mapping expire? @@ -162,7 +162,7 @@ reconnect (struct GNUNET_VPN_Handle *vh); /** * Function called when we receive a message from the VPN service. * - * @param cls the 'struct GNUNET_VPN_Handle' + * @param cls the `struct GNUNET_VPN_Handle` * @param msg message received, NULL on timeout or fatal error */ static void @@ -475,7 +475,7 @@ GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh, return rr; } - + /** * Tell the VPN that forwarding to the Internet via some exit node is * requested. Note that both UDP and TCP traffic will be forwarded, |