gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: use existing pf probe funct


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: use existing pf probe function from network.c instead of re-implementing it in service.c
Date: Sat, 02 Mar 2019 11:27:15 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new bb3ff9584 use existing pf probe function from network.c instead of 
re-implementing it in service.c
bb3ff9584 is described below

commit bb3ff9584ea7ac92b742d2f435173dbd0d4f1589
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Mar 2 11:27:11 2019 +0100

    use existing pf probe function from network.c instead of re-implementing it 
in service.c
---
 src/util/client.c  |  5 +++--
 src/util/service.c | 52 ++++++++--------------------------------------------
 2 files changed, 11 insertions(+), 46 deletions(-)

diff --git a/src/util/client.c b/src/util/client.c
index 356123e94..05e05a328 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -847,12 +847,13 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq,
   GNUNET_assert (NULL == cstate->send_task);
   cstate->msg = msg;
   cstate->msg_off = 0;
-  if (NULL == cstate->sock){
+  if (NULL == cstate->sock)
+  {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "message of type %u waiting for socket\n",
          ntohs(msg->type));
     return; /* still waiting for connection */
-   }
+  }
   cstate->send_task
     = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                       cstate->sock,
diff --git a/src/util/service.c b/src/util/service.c
index 3f7b74e0d..b2e3e89cc 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1132,50 +1132,14 @@ get_server_addresses (const char *service_name,
   *addrs = NULL;
   *addr_lens = NULL;
   desc = NULL;
-  if (GNUNET_CONFIGURATION_have_value (cfg,
-                                      service_name,
-                                      "DISABLEV6"))
-  {
-    if (GNUNET_SYSERR ==
-        (disablev6 =
-         GNUNET_CONFIGURATION_get_value_yesno (cfg,
-                                              service_name,
-                                              "DISABLEV6")))
-      return GNUNET_SYSERR;
-  }
-  else
-    disablev6 = GNUNET_NO;
-
-  if (! disablev6)
-  {
-    /* probe IPv6 support */
-    desc = GNUNET_NETWORK_socket_create (PF_INET6,
-                                        SOCK_STREAM,
-                                        0);
-    if (NULL == desc)
-    {
-      if ( (ENOBUFS == errno) ||
-          (ENOMEM == errno) ||
-          (ENFILE == errno) ||
-          (EACCES == errno) )
-      {
-        LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR,
-                     "socket");
-        return GNUNET_SYSERR;
-      }
-      LOG (GNUNET_ERROR_TYPE_INFO,
-           _("Disabling IPv6 support for service `%s', failed to create IPv6 
socket: %s\n"),
-           service_name,
-          STRERROR (errno));
-      disablev6 = GNUNET_YES;
-    }
-    else
-    {
-      GNUNET_break (GNUNET_OK ==
-                   GNUNET_NETWORK_socket_close (desc));
-      desc = NULL;
-    }
-  }
+  disablev6 = GNUNET_NO;
+  if ( (GNUNET_NO ==
+       GNUNET_NETWORK_test_pf (PF_INET6)) ||
+       (GNUNET_YES ==
+       GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                             service_name,
+                                             "DISABLEV6") ) )
+    disablev6 = GNUNET_YES;
 
   port = 0;
   if (GNUNET_CONFIGURATION_have_value (cfg,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]