diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-09 16:57:01 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-09 16:57:11 +0100 |
commit | fd58a3abc404e67e96901e48436922937ea1d629 (patch) | |
tree | aad2e3619fbac8ad881fde59a6d257a4779be998 /src/nat/gnunet-service-nat_helper.c | |
parent | c0862506a76c168626ecfd32989fd6718c67ff89 (diff) | |
download | gnunet-fd58a3abc404e67e96901e48436922937ea1d629.tar.gz gnunet-fd58a3abc404e67e96901e48436922937ea1d629.zip |
fix issue with NAT logic overwriting port specified by user in manual hole punch; adding some logging
Diffstat (limited to 'src/nat/gnunet-service-nat_helper.c')
-rw-r--r-- | src/nat/gnunet-service-nat_helper.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/nat/gnunet-service-nat_helper.c b/src/nat/gnunet-service-nat_helper.c index e91f63beb..de6531fa8 100644 --- a/src/nat/gnunet-service-nat_helper.c +++ b/src/nat/gnunet-service-nat_helper.c | |||
@@ -221,6 +221,26 @@ restart_nat_server (void *cls) | |||
221 | char ia[INET_ADDRSTRLEN]; | 221 | char ia[INET_ADDRSTRLEN]; |
222 | 222 | ||
223 | h->server_read_task = NULL; | 223 | h->server_read_task = NULL; |
224 | GNUNET_assert (NULL != | ||
225 | inet_ntop (AF_INET, | ||
226 | &h->internal_address, | ||
227 | ia, | ||
228 | sizeof (ia))); | ||
229 | /* Start the server process */ | ||
230 | binary | ||
231 | = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-server"); | ||
232 | if (GNUNET_YES != | ||
233 | GNUNET_OS_check_helper_binary (binary, | ||
234 | GNUNET_YES, | ||
235 | ia)) | ||
236 | { | ||
237 | /* move instantly to max delay, as this is unlikely to be fixed */ | ||
238 | h->server_retry_delay | ||
239 | = GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD; | ||
240 | GNUNET_free (binary); | ||
241 | try_again (h); | ||
242 | return; | ||
243 | } | ||
224 | h->server_stdout | 244 | h->server_stdout |
225 | = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, | 245 | = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, |
226 | GNUNET_NO, GNUNET_YES); | 246 | GNUNET_NO, GNUNET_YES); |
@@ -228,21 +248,14 @@ restart_nat_server (void *cls) | |||
228 | { | 248 | { |
229 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, | 249 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, |
230 | "pipe"); | 250 | "pipe"); |
251 | GNUNET_free (binary); | ||
231 | try_again (h); | 252 | try_again (h); |
232 | return; | 253 | return; |
233 | } | 254 | } |
234 | GNUNET_assert (NULL != | ||
235 | inet_ntop (AF_INET, | ||
236 | &h->internal_address, | ||
237 | ia, | ||
238 | sizeof (ia))); | ||
239 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 255 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
240 | "Starting `%s' at `%s'\n", | 256 | "Starting `%s' at `%s'\n", |
241 | "gnunet-helper-nat-server", | 257 | "gnunet-helper-nat-server", |
242 | ia); | 258 | ia); |
243 | /* Start the server process */ | ||
244 | binary | ||
245 | = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-server"); | ||
246 | h->server_proc | 259 | h->server_proc |
247 | = GNUNET_OS_start_process (GNUNET_NO, | 260 | = GNUNET_OS_start_process (GNUNET_NO, |
248 | 0, | 261 | 0, |