aboutsummaryrefslogtreecommitdiff
path: root/src/exit
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-20 15:26:03 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-20 15:26:03 +0000
commitd544e81283a24082e6423c8f4377939f6fefa780 (patch)
treeab8aaf264cdd6d27853ff15a2f7542c801acf721 /src/exit
parenta0a09022f0d0df917465b8e71753a69f066058d3 (diff)
downloadgnunet-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/exit')
-rw-r--r--src/exit/gnunet-daemon-exit.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index 743b5bf31..6afb38fd9 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -787,7 +787,7 @@ store_service (struct GNUNET_CONTAINER_MultiHashMap *service_map,
787 char key[sizeof (struct GNUNET_HashCode) + sizeof (uint16_t)]; 787 char key[sizeof (struct GNUNET_HashCode) + sizeof (uint16_t)];
788 struct GNUNET_HashCode desc; 788 struct GNUNET_HashCode desc;
789 789
790 GNUNET_CRYPTO_hash (name, strlen (name) + 1, &desc); 790 GNUNET_TUN_service_name_to_hash (name, &desc);
791 service->name = GNUNET_strdup (name); 791 service->name = GNUNET_strdup (name);
792 memcpy (&key[0], &destination_port, sizeof (uint16_t)); 792 memcpy (&key[0], &destination_port, sizeof (uint16_t));
793 memcpy (&key[sizeof(uint16_t)], &desc, sizeof (struct GNUNET_HashCode)); 793 memcpy (&key[sizeof(uint16_t)], &desc, sizeof (struct GNUNET_HashCode));
@@ -3220,7 +3220,7 @@ add_services (int proto,
3220 if (NULL == (hostname = strstr (redirect, ":"))) 3220 if (NULL == (hostname = strstr (redirect, ":")))
3221 { 3221 {
3222 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3222 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
3223 "option `%s' for domain `%s' is not formatted correctly!\n", 3223 _("Option `%s' for domain `%s' is not formatted correctly!\n"),
3224 redirect, 3224 redirect,
3225 name); 3225 name);
3226 continue; 3226 continue;
@@ -3230,7 +3230,7 @@ add_services (int proto,
3230 if (NULL == (hostport = strstr (hostname, ":"))) 3230 if (NULL == (hostport = strstr (hostname, ":")))
3231 { 3231 {
3232 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3232 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
3233 "option `%s' for domain `%s' is not formatted correctly!\n", 3233 _("Option `%s' for domain `%s' is not formatted correctly!\n"),
3234 redirect, 3234 redirect,
3235 name); 3235 name);
3236 continue; 3236 continue;
@@ -3244,14 +3244,16 @@ add_services (int proto,
3244 if (!((local_port > 0) && (local_port < 65536))) 3244 if (!((local_port > 0) && (local_port < 65536)))
3245 { 3245 {
3246 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3246 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
3247 "`%s' is not a valid port number (for domain `%s')!", redirect, 3247 _("`%s' is not a valid port number (for domain `%s')!"),
3248 redirect,
3248 name); 3249 name);
3249 continue; 3250 continue;
3250 } 3251 }
3251 if (!((remote_port > 0) && (remote_port < 65536))) 3252 if (!((remote_port > 0) && (remote_port < 65536)))
3252 { 3253 {
3253 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3254 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
3254 "`%s' is not a valid port number (for domain `%s')!", hostport, 3255 _("`%s' is not a valid port number (for domain `%s')!"),
3256 hostport,
3255 name); 3257 name);
3256 continue; 3258 continue;
3257 } 3259 }