aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-01-27 13:13:18 +0100
committert3sserakt <t3ss@posteo.de>2023-01-27 13:13:18 +0100
commitd3d994d338667d4bc263c8a6832cb592d678422f (patch)
tree8d78903768024db106d3776acf83857badecd8cd /src/transport
parentf5d40212ba3934b8138c6db29b0afe8b2fadd7d3 (diff)
downloadgnunet-d3d994d338667d4bc263c8a6832cb592d678422f.tar.gz
gnunet-d3d994d338667d4bc263c8a6832cb592d678422f.zip
TNG: Added tcp icmp nat hole punching test case script, and fixed bugs occuring during shutdown.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/Makefile.am2
-rw-r--r--src/transport/transport_api2_communication.c21
-rw-r--r--src/transport/transport_api_cmd_start_peer.c6
3 files changed, 13 insertions, 16 deletions
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
761if HAVE_EXPERIMENTAL 761if HAVE_EXPERIMENTAL
762check_SCRIPTS= \ 762check_SCRIPTS= \
763test_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
1511EXTRA_DIST = \ 1512EXTRA_DIST = \
1513test_transport_nat_icmp_tcp.sh \
1512test_transport_nat_upnp.sh \ 1514test_transport_nat_upnp.sh \
1513test_transport_simple_send_string.sh \ 1515test_transport_simple_send_string.sh \
1514test_transport_simple_send.sh \ 1516test_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
1074GNUNET_TRANSPORT_communicator_address_remove_all ( 1063GNUNET_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);