remove port from transport section because it was getting in the way of making sense...
[oweals/gnunet.git] / src / transport / gnunet-nat-server.c
index 7892d8f93cd362fca74f459e090fa305f604b715..ab99b5f280d7f059ee4362e11b675d0b8983e413 100644 (file)
@@ -582,8 +582,8 @@ main (int argc,
   if (1 != inet_pton (AF_INET, argv[1], &external))
     {
       fprintf (stderr,
-              "Error parsing IPv4 address: %s\n",
-              strerror (errno));
+              "Error parsing IPv4 address: %s\n",
+              strerror (errno));
       return 1;
     }
   if (1 != inet_pton (AF_INET, DUMMY_IP, &dummy))
@@ -631,8 +631,10 @@ main (int argc,
                   strerror (errno));
          break;
        }
+      if (1 == getppid()) /* Check the parent process id, if 1 the parent has died, so we should die too */
+        break;
       if (FD_ISSET (icmpsock, &rs))
-       process_icmp_response ();
+        process_icmp_response ();
       if (0 == (++alt % 2))
        send_icmp_echo (&external);
       else