client
authorChristian Grothoff <christian@grothoff.org>
Thu, 4 Feb 2010 14:15:59 +0000 (14:15 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 4 Feb 2010 14:15:59 +0000 (14:15 +0000)
src/transport/gnunet-nat-client.c
src/transport/gnunet-nat-server.c

index c4b327aac94f7d014e5c6a576c6ed01c3ca7cb97..ada7b3b188eb7f57d18203ab4cef62ae3602ae36 100644 (file)
@@ -121,6 +121,8 @@ static int rawsock;
 
 static struct in_addr dummy;
  
+static struct in_addr target;
+
 
 /**
  * create a random port number that is not totally
@@ -403,6 +405,7 @@ process_icmp_response (const struct in_addr *my_ip,
     }
   else
     {
+      send_icmp (my_ip, &target, reply_magic, my_magic);
       printf ("%s:%u\n",
              inet_ntop (AF_INET,
                         &sip,
@@ -479,7 +482,6 @@ make_raw_socket ()
 int
 main (int argc, char *const *argv)
 {
-  struct in_addr target;
   struct in_addr external;
   unsigned int i;  
   unsigned int pos;
index 77b73b708593f64a96b2eea3807f2f0cf3c1545f..0bf39823108db4dfb12169053910bcea57531b0f 100644 (file)
@@ -376,8 +376,8 @@ process_icmp_response (const struct in_addr *my_ip,
       return;
     }
   memcpy(&sip, &ip_pkt.src_ip, sizeof (sip));
-  my_magic = ntohs (udp_pkt.checksum_aka_my_magic);
-  reply_magic = ntohs (udp_pkt.mlen_aka_reply_port_magic);
+  reply_magic = ntohs (udp_pkt.checksum_aka_my_magic);
+  my_magic = ntohs (udp_pkt.mlen_aka_reply_port_magic);
   fprintf (stderr,
           "Received ICMP from `%s' with hints %u and %u\n",
           inet_ntop (AF_INET,