From: Christian Grothoff Date: Mon, 14 Apr 2014 16:21:43 +0000 (+0000) Subject: -grab source IP from outer IP header, not from inner IP header X-Git-Tag: initial-import-from-subversion-38251~4196 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=29ed96cadc9f4a685d70589db4ff30dc516c1d63;p=oweals%2Fgnunet.git -grab source IP from outer IP header, not from inner IP header --- diff --git a/src/nat/gnunet-helper-nat-server.c b/src/nat/gnunet-helper-nat-server.c index 71057beec..b0bdbf009 100644 --- a/src/nat/gnunet-helper-nat-server.c +++ b/src/nat/gnunet-helper-nat-server.c @@ -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)));