Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / nat / gnunet-nat.c
index 07ddfb6a3efdd80ae8cd5ac895a20afb0097367b..80bfb5726d83ea28fcec10025785a47ed6a26386 100644 (file)
@@ -37,7 +37,7 @@ static int global_ret;
  * Name of section in configuration file to use for 
  * additional options.
  */ 
-static char *section_name = "undefined";
+static char *section_name;
 
 /**
  * Flag set to 1 if we use IPPROTO_UDP.
@@ -283,6 +283,9 @@ run (void *cls,
       return;
     }
   }
+
+  remote_len = 0;
+
   if (NULL != remote_addr)
   {
     remote_len = GNUNET_STRINGS_parse_socket_addr (remote_addr,
@@ -300,6 +303,8 @@ run (void *cls,
 
   if (NULL != local_addr)
   {
+    if (NULL == section_name)
+      section_name = GNUNET_strdup ("undefined");
     nh = GNUNET_NAT_register (c,
                              section_name,
                              proto,