diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-04-14 16:21:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-04-14 16:21:43 +0000 |
commit | 29ed96cadc9f4a685d70589db4ff30dc516c1d63 (patch) | |
tree | 8f755918732525eae4bbc5dde8235a908a8841a1 | |
parent | 0e328f267643c725ea3bc9bc6ac21cf35b2ea233 (diff) | |
download | gnunet-29ed96cadc9f4a685d70589db4ff30dc516c1d63.tar.gz gnunet-29ed96cadc9f4a685d70589db4ff30dc516c1d63.zip |
-grab source IP from outer IP header, not from inner IP header
-rw-r--r-- | src/nat/gnunet-helper-nat-server.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 () | |||
372 | /* different type than what we want */ | 372 | /* different type than what we want */ |
373 | return; | 373 | return; |
374 | } | 374 | } |
375 | /* grab source IP of 1st IP header */ | ||
376 | source_ip.s_addr = ip_pkt.src_ip; | ||
377 | |||
375 | /* skip 2nd IP header */ | 378 | /* skip 2nd IP header */ |
376 | memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); | 379 | memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); |
377 | off += sizeof (struct ip_header); | 380 | off += sizeof (struct ip_header); |
@@ -408,7 +411,6 @@ process_icmp_response () | |||
408 | return; | 411 | return; |
409 | } | 412 | } |
410 | 413 | ||
411 | source_ip.s_addr = ip_pkt.src_ip; | ||
412 | if (port == 0) | 414 | if (port == 0) |
413 | fprintf (stdout, "%s\n", | 415 | fprintf (stdout, "%s\n", |
414 | inet_ntop (AF_INET, &source_ip, buf, sizeof (buf))); | 416 | inet_ntop (AF_INET, &source_ip, buf, sizeof (buf))); |