-fix getting output from sysctl into service-helper interactions
authorChristian Grothoff <christian@grothoff.org>
Fri, 20 Jan 2012 17:47:07 +0000 (17:47 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 20 Jan 2012 17:47:07 +0000 (17:47 +0000)
src/dns/gnunet-helper-dns.c
src/exit/gnunet-daemon-exit.c
src/exit/gnunet-helper-exit.c
src/util/server_mst.c

index 73536c252af4d2c74e407fa49e73d3e6608344c7..22c6ef35926d5dcc021ecab843e327c8cce00caa 100644 (file)
@@ -173,6 +173,10 @@ fork_and_exec (const char *file,
   if (0 == pid)
   {
     /* we are the child process */
+    /* close stdin/stdout to not cause interference
+       with the helper's main protocol! */
+    (void) close (0); 
+    (void) close (1); 
     (void) execv (file, cmd);
     /* can only get here on error */
     fprintf (stderr, 
index 9bdfba7da425aec35d26a0de7558bc977cbc914d..8e29351f8d19e843f41accde7b63af5de392f4b3 100644 (file)
@@ -678,7 +678,7 @@ tcp_from_helper (const struct GNUNET_TUN_TcpHeader *tcp,
                           sbuf, sizeof (sbuf)),
                (unsigned int) ntohs (tcp->spt),
                inet_ntop (af,
-                          source_ip,
+                          destination_ip,
                           dbuf, sizeof (dbuf)),
                (unsigned int) ntohs (tcp->dpt));
   }
@@ -745,6 +745,10 @@ message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
   const struct GNUNET_TUN_Layer2PacketHeader *pkt_tun;
   size_t size;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Got %u-byte message of type %u from gnunet-helper-exit\n",
+             ntohs (message->size),
+             ntohs (message->type));
   GNUNET_STATISTICS_update (stats,
                            gettext_noop ("# Packets received from TUN"),
                            1, GNUNET_NO);
index 57944cf6112c9557df470111638e43bba9a3d28a..5a9be473c7d8a0a6b53dd6bc8356589e76e64384 100644 (file)
@@ -110,6 +110,10 @@ fork_and_exec (const char *file,
   if (0 == pid)
   {
     /* we are the child process */
+    /* close stdin/stdout to not cause interference
+       with the helper's main protocol! */
+    (void) close (0); 
+    (void) close (1); 
     (void) execv (file, cmd);
     /* can only get here on error */
     fprintf (stderr, 
index dcb8c48102f631287d2de3f14f07d797ab2d33e9..026601eb9fe09b210e8ab00c56bad09b2d672902 100644 (file)
@@ -31,7 +31,7 @@
 #include "gnunet_server_lib.h"
 #include "gnunet_time_lib.h"
 
-#define DEBUG_SERVER_MST GNUNET_EXTRA_LOGGING
+#define DEBUG_SERVER_MST GNUNET_EXTRA_LOGGING 
 
 #if HAVE_UNALIGNED_64_ACCESS
 #define ALIGN_FACTOR 4