From 29ed96cadc9f4a685d70589db4ff30dc516c1d63 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 14 Apr 2014 16:21:43 +0000 Subject: -grab source IP from outer IP header, not from inner IP header --- src/nat/gnunet-helper-nat-server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nat/gnunet-helper-nat-server.c') 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))); -- cgit v1.2.3