gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: fix minor bugs


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fix minor bugs
Date: Fri, 16 Dec 2016 12:07:24 +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 1a5afc1  fix minor bugs
1a5afc1 is described below

commit 1a5afc122701558b20e95f34115145bb79180f03
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Dec 16 12:07:11 2016 +0100

    fix minor bugs
---
 src/nat/gnunet-nat.c         | 67 ++++++++++++++++++++++++--------------------
 src/nat/gnunet-service-nat.c |  2 +-
 src/nat/nat_api.c            |  2 +-
 3 files changed, 39 insertions(+), 32 deletions(-)

diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c
index 0574f43..ff326fe 100644
--- a/src/nat/gnunet-nat.c
+++ b/src/nat/gnunet-nat.c
@@ -176,34 +176,38 @@ auto_config_cb (void *cls,
   ah = NULL;
   switch (type)
   {
-    case GNUNET_NAT_TYPE_NO_NAT:
-      nat_type = "NO NAT";
-      break;
-    case GNUNET_NAT_TYPE_UNREACHABLE_NAT:
-      nat_type = "NAT but we can traverse";
-      break;
-    case GNUNET_NAT_TYPE_STUN_PUNCHED_NAT:
-      nat_type = "NAT but STUN is able to identify the correct information";
-      break;
-    case GNUNET_NAT_TYPE_UPNP_NAT:
-      nat_type = "NAT but UPNP opened the ports";
-      break;
-    default:
-      SPRINTF (unknown_type,
-              "NAT unknown, type %u",
-              type);
-      nat_type = unknown_type;
+  case GNUNET_NAT_TYPE_NO_NAT:
+    nat_type = "NO NAT";
+    break;
+  case GNUNET_NAT_TYPE_UNREACHABLE_NAT:
+    nat_type = "NAT but we can traverse";
+    break;
+  case GNUNET_NAT_TYPE_STUN_PUNCHED_NAT:
+    nat_type = "NAT but STUN is able to identify the correct information";
+    break;
+  case GNUNET_NAT_TYPE_UPNP_NAT:
+    nat_type = "NAT but UPNP opened the ports";
+    break;
+  default:
+    SPRINTF (unknown_type,
+            "NAT unknown, type %u",
+            type);
+    nat_type = unknown_type;
+    break;
   }
 
   PRINTF ("NAT status: %s/%s\n",
          GNUNET_NAT_status2string (result),
          nat_type);
-  
-  PRINTF ("SUGGESTED CHANGES:\n");
-  GNUNET_CONFIGURATION_iterate_section_values (diff,
-                                               "nat",
-                                               &auto_conf_iter,
-                                               NULL);
+
+  if (NULL != diff)
+  {
+    PRINTF ("SUGGESTED CHANGES:\n");
+    GNUNET_CONFIGURATION_iterate_section_values (diff,
+                                                "nat",
+                                                &auto_conf_iter,
+                                                NULL);
+  }
   // FIXME: have option to save config
   test_finished ();
 }
@@ -396,8 +400,18 @@ run (void *cls,
     proto = IPPROTO_TCP;
   if (use_udp)
     proto = IPPROTO_UDP;
+
+  if (do_auto)
+  {
+    ah = GNUNET_NAT_autoconfig_start (c,
+                                     &auto_config_cb,
+                                     NULL);
+  }
+
   if (0 == proto)
   {
+    if (do_auto)
+      return; /* all good, we just run auto config */
     GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
                "Must specify either TCP or UDP\n");
     global_ret = 1;
@@ -530,13 +544,6 @@ run (void *cls,
     }
   }
   
-  if (do_auto)
-  {
-    ah = GNUNET_NAT_autoconfig_start (c,
-                                     &auto_config_cb,
-                                     NULL);
-  }
-
   if (do_stun)
   {
     if (NULL == local_addr)
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 1ebf756..0da8548 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -351,7 +351,7 @@ match_ipv6 (const char *network,
   
   if (0 == bits)
     return GNUNET_YES;
-  GNUNET_assert (1 == inet_pton (AF_INET,
+  GNUNET_assert (1 == inet_pton (AF_INET6,
                                 network,
                                 &net));
   memset (&mask, 0, sizeof (mask));
diff --git a/src/nat/nat_api.c b/src/nat/nat_api.c
index cab2b65..798da0e 100644
--- a/src/nat/nat_api.c
+++ b/src/nat/nat_api.c
@@ -737,7 +737,7 @@ GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err)
   case GNUNET_NAT_ERROR_SUCCESS:
     return _ ("Operation Successful");
   case GNUNET_NAT_ERROR_IPC_FAILURE:
-    return _ ("Internal Failure (IPC, ...)");
+    return _ ("IPC failure");
   case GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR:
     return _ ("Failure in network subsystem, check permissions.");
   case GNUNET_NAT_ERROR_TIMEOUT:

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



reply via email to

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