diff options
author | t3sserakt <t3ss@posteo.de> | 2023-01-27 13:13:18 +0100 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-01-27 13:13:18 +0100 |
commit | d3d994d338667d4bc263c8a6832cb592d678422f (patch) | |
tree | 8d78903768024db106d3776acf83857badecd8cd | |
parent | f5d40212ba3934b8138c6db29b0afe8b2fadd7d3 (diff) | |
download | gnunet-d3d994d338667d4bc263c8a6832cb592d678422f.tar.gz gnunet-d3d994d338667d4bc263c8a6832cb592d678422f.zip |
TNG: Added tcp icmp nat hole punching test case script, and fixed bugs occuring during shutdown.
-rw-r--r-- | src/testing/testing_api_cmd_netjail_start_cmds_helper.c | 4 | ||||
-rw-r--r-- | src/transport/Makefile.am | 2 | ||||
-rw-r--r-- | src/transport/transport_api2_communication.c | 21 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_start_peer.c | 6 | ||||
-rw-r--r-- | src/util/mq.c | 4 |
5 files changed, 16 insertions, 21 deletions
diff --git a/src/testing/testing_api_cmd_netjail_start_cmds_helper.c b/src/testing/testing_api_cmd_netjail_start_cmds_helper.c index 545b89b33..619392119 100644 --- a/src/testing/testing_api_cmd_netjail_start_cmds_helper.c +++ b/src/testing/testing_api_cmd_netjail_start_cmds_helper.c | |||
@@ -489,6 +489,7 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | |||
489 | } else if (ns->number_of_local_tests_finished == total_number) | 489 | } else if (ns->number_of_local_tests_finished == total_number) |
490 | { | 490 | { |
491 | GNUNET_SCHEDULER_cancel (ns->timeout_task); | 491 | GNUNET_SCHEDULER_cancel (ns->timeout_task); |
492 | ns->timeout_task = NULL; | ||
492 | GNUNET_TESTING_async_finish (&ns->ac); | 493 | GNUNET_TESTING_async_finish (&ns->ac); |
493 | } | 494 | } |
494 | break; | 495 | break; |
@@ -525,7 +526,8 @@ exp_cb (void *cls) | |||
525 | struct NetJailState *ns = cls; | 526 | struct NetJailState *ns = cls; |
526 | 527 | ||
527 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called exp_cb.\n"); | 528 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called exp_cb.\n"); |
528 | GNUNET_SCHEDULER_cancel (ns->timeout_task); | 529 | if (NULL != ns->timeout_task) |
530 | GNUNET_SCHEDULER_cancel (ns->timeout_task); | ||
529 | GNUNET_TESTING_async_fail (&(ns->ac)); | 531 | GNUNET_TESTING_async_fail (&(ns->ac)); |
530 | } | 532 | } |
531 | 533 | ||
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 0059861c2..5acba3a4e 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -760,6 +760,7 @@ endif | |||
760 | # Only test TNG if we run experimental | 760 | # Only test TNG if we run experimental |
761 | if HAVE_EXPERIMENTAL | 761 | if HAVE_EXPERIMENTAL |
762 | check_SCRIPTS= \ | 762 | check_SCRIPTS= \ |
763 | test_transport_nat_icmp_tcp.sh \ | ||
763 | test_transport_nat_upnp.sh \ | 764 | test_transport_nat_upnp.sh \ |
764 | test_transport_simple_send_string.sh \ | 765 | test_transport_simple_send_string.sh \ |
765 | test_transport_simple_send.sh \ | 766 | test_transport_simple_send.sh \ |
@@ -1509,6 +1510,7 @@ test_transport_api_slow_ats_LDADD = \ | |||
1509 | 1510 | ||
1510 | 1511 | ||
1511 | EXTRA_DIST = \ | 1512 | EXTRA_DIST = \ |
1513 | test_transport_nat_icmp_tcp.sh \ | ||
1512 | test_transport_nat_upnp.sh \ | 1514 | test_transport_nat_upnp.sh \ |
1513 | test_transport_simple_send_string.sh \ | 1515 | test_transport_simple_send_string.sh \ |
1514 | test_transport_simple_send.sh \ | 1516 | test_transport_simple_send.sh \ |
diff --git a/src/transport/transport_api2_communication.c b/src/transport/transport_api2_communication.c index b79f0d8bf..079982ca5 100644 --- a/src/transport/transport_api2_communication.c +++ b/src/transport/transport_api2_communication.c | |||
@@ -1048,21 +1048,10 @@ GNUNET_TRANSPORT_communicator_address_remove ( | |||
1048 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch = ai->ch; | 1048 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch = ai->ch; |
1049 | 1049 | ||
1050 | send_del_address (ai); | 1050 | send_del_address (ai); |
1051 | if (NULL == ai->prev) | ||
1052 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1053 | "prev null\n"); | ||
1054 | if (ch->ai_head == ai) | ||
1055 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1056 | "equals head\n"); | ||
1057 | if (NULL == ai->next) | ||
1058 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1059 | "next null\n"); | ||
1060 | if (ch->ai_tail == ai) | ||
1061 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1062 | "equals tail\n"); | ||
1063 | GNUNET_CONTAINER_DLL_remove (ch->ai_head, ch->ai_tail, ai); | 1051 | GNUNET_CONTAINER_DLL_remove (ch->ai_head, ch->ai_tail, ai); |
1064 | GNUNET_free (ai->address); | 1052 | GNUNET_free (ai->address); |
1065 | GNUNET_free (ai); | 1053 | GNUNET_free (ai); |
1054 | ai = NULL; | ||
1066 | } | 1055 | } |
1067 | 1056 | ||
1068 | /** | 1057 | /** |
@@ -1074,9 +1063,13 @@ void | |||
1074 | GNUNET_TRANSPORT_communicator_address_remove_all ( | 1063 | GNUNET_TRANSPORT_communicator_address_remove_all ( |
1075 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch) | 1064 | struct GNUNET_TRANSPORT_CommunicatorHandle *ch) |
1076 | { | 1065 | { |
1077 | for (struct GNUNET_TRANSPORT_AddressIdentifier *ai = ch->ai_head; NULL != ai; | 1066 | struct GNUNET_TRANSPORT_AddressIdentifier *ai = ch->ai_head; |
1078 | ai = ai->next) | 1067 | while (NULL != ai) |
1068 | { | ||
1069 | struct GNUNET_TRANSPORT_AddressIdentifier *ai_next = ai->next; | ||
1079 | GNUNET_TRANSPORT_communicator_address_remove (ai); | 1070 | GNUNET_TRANSPORT_communicator_address_remove (ai); |
1071 | ai = ai_next; | ||
1072 | } | ||
1080 | } | 1073 | } |
1081 | 1074 | ||
1082 | 1075 | ||
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c index 516f8d0aa..1f8ef2f8f 100644 --- a/src/transport/transport_api_cmd_start_peer.c +++ b/src/transport/transport_api_cmd_start_peer.c | |||
@@ -244,6 +244,7 @@ start_peer_run (void *cls, | |||
244 | "UNIXPATH", | 244 | "UNIXPATH", |
245 | udp_communicator_unix_path); | 245 | udp_communicator_unix_path); |
246 | 246 | ||
247 | |||
247 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 248 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
248 | sps->system_label); | 249 | sps->system_label); |
249 | GNUNET_TESTING_get_trait_test_system (system_cmd, | 250 | GNUNET_TESTING_get_trait_test_system (system_cmd, |
@@ -384,11 +385,12 @@ start_peer_cleanup (void *cls) | |||
384 | GNUNET_free (sps->handlers); | 385 | GNUNET_free (sps->handlers); |
385 | sps->handlers = NULL; | 386 | sps->handlers = NULL; |
386 | } | 387 | } |
387 | if (NULL != sps->cfg) | 388 | //TODO Investigate why this caused problems during shutdown. |
389 | /*if (NULL != sps->cfg) | ||
388 | { | 390 | { |
389 | GNUNET_CONFIGURATION_destroy (sps->cfg); | 391 | GNUNET_CONFIGURATION_destroy (sps->cfg); |
390 | sps->cfg = NULL; | 392 | sps->cfg = NULL; |
391 | } | 393 | }*/ |
392 | GNUNET_free (sps->cfgname); | 394 | GNUNET_free (sps->cfgname); |
393 | GNUNET_free (sps->node_ip); | 395 | GNUNET_free (sps->node_ip); |
394 | GNUNET_free (sps->system_label); | 396 | GNUNET_free (sps->system_label); |
diff --git a/src/util/mq.c b/src/util/mq.c index 788b9b636..de0cff0c2 100644 --- a/src/util/mq.c +++ b/src/util/mq.c | |||
@@ -304,10 +304,6 @@ void | |||
304 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, | 304 | GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, |
305 | struct GNUNET_MQ_Envelope *ev) | 305 | struct GNUNET_MQ_Envelope *ev) |
306 | { | 306 | { |
307 | if (NULL == mq) | ||
308 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
309 | "mq is NUll when sending message of type %u\n", | ||
310 | (unsigned int) ntohs (ev->mh->type)); | ||
311 | GNUNET_assert (NULL != mq); | 307 | GNUNET_assert (NULL != mq); |
312 | GNUNET_assert (NULL == ev->parent_queue); | 308 | GNUNET_assert (NULL == ev->parent_queue); |
313 | 309 | ||