diff options
-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))); |