use #5553 function in TCP/UDP communicators
authorChristian Grothoff <christian@grothoff.org>
Sat, 2 Mar 2019 10:21:06 +0000 (11:21 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sat, 2 Mar 2019 10:21:06 +0000 (11:21 +0100)
src/transport/gnunet-communicator-tcp.c
src/transport/gnunet-communicator-udp.c

index 47bffa2baa42e2d06f23aec10041c6cd6deaffc7..95719852c6d7c63ef0647e3526250be839f77d5b 100644 (file)
@@ -24,7 +24,6 @@
  * @author Christian Grothoff
  *
  * TODO:
- * - add and use util/ check for IPv6 availability (#5553)
  * - support DNS names in BINDTO option (#5528)
  * - support NAT connection reversal method (#5529)
  * - support other TCP-specific NAT traversal methods (#5531)
@@ -1172,12 +1171,12 @@ tcp_address_to_sockaddr (const char *bindto,
                  bindto);
       return NULL;
     }
-    /* FIXME: add test to util/ for IPv6 availability,
-       and depending on the result, go directly for v4-only */
-    if (GNUNET_YES ==
-       GNUNET_CONFIGURATION_get_value_yesno (cfg,
-                                             COMMUNICATOR_CONFIG_SECTION,
-                                             "DISABLE_V6"))
+    if ( (GNUNET_NO ==
+         GNUNET_NETWORK_test_pf (PF_INET6)) ||
+        (GNUNET_YES ==
+         GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                               COMMUNICATOR_CONFIG_SECTION,
+                                               "DISABLE_V6")) )
     {
       struct sockaddr_in *i4;
 
index 550ba7c854cb2061906dc7e7e7b85f93fdc6ea3d..fa8eb6acb913e602e45cf58158795abfccc29ff6 100644 (file)
@@ -24,7 +24,6 @@
  * @author Christian Grothoff
  *
  * TODO:
- * - add and use util/ check for IPv6 availability (#5553)
  * - consider imposing transmission limits in the absence
  *   of ACKs; or: maybe this should be done at TNG service level?
  *   (at least the receiver might want to enforce limits on
@@ -1784,12 +1783,12 @@ udp_address_to_sockaddr (const char *bindto,
                  bindto);
       return NULL;
     }
-    /* FIXME #V6: add test to util/ for IPv6 availability,
-       and depending on the result, go directly for v4-only */
-    if (GNUNET_YES ==
-       GNUNET_CONFIGURATION_get_value_yesno (cfg,
-                                             COMMUNICATOR_CONFIG_SECTION,
-                                             "DISABLE_V6"))
+    if ( (GNUNET_NO ==
+         GNUNET_NETWORK_test_pf (PF_INET6)) ||
+        (GNUNET_YES ==
+         GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                               COMMUNICATOR_CONFIG_SECTION,
+                                               "DISABLE_V6")) )
     {
       struct sockaddr_in *i4;