-grab source IP from outer IP header, not from inner IP header
authorChristian Grothoff <christian@grothoff.org>
Mon, 14 Apr 2014 16:21:43 +0000 (16:21 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 14 Apr 2014 16:21:43 +0000 (16:21 +0000)
src/nat/gnunet-helper-nat-server.c

index 71057beec1d2717fff5fbce45eca54fde5026a56..b0bdbf0099e2bc7efe4a9f9615baa066cede6fa6 100644 (file)
@@ -372,6 +372,9 @@ process_icmp_response ()
     /* different type than what we want */
     return;
   }
+  /* grab source IP of 1st IP header */
+  source_ip.s_addr = ip_pkt.src_ip;
+
   /* skip 2nd IP header */
   memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header));
   off += sizeof (struct ip_header);
@@ -408,7 +411,6 @@ process_icmp_response ()
     return;
   }
 
-  source_ip.s_addr = ip_pkt.src_ip;
   if (port == 0)
     fprintf (stdout, "%s\n",
              inet_ntop (AF_INET, &source_ip, buf, sizeof (buf)));