From 17f94e7fc0dfabbbd9868b72f957209549a16b5a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 16 Dec 2011 12:10:03 +0000 Subject: [PATCH] -make assignment cleaner, move to where it is needed --- src/nat/gnunet-helper-nat-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nat/gnunet-helper-nat-server.c b/src/nat/gnunet-helper-nat-server.c index 733c00dc2..583a2f082 100644 --- a/src/nat/gnunet-helper-nat-server.c +++ b/src/nat/gnunet-helper-nat-server.c @@ -359,7 +359,6 @@ process_icmp_response () off = 0; memcpy (&ip_pkt, &buf[off], sizeof (struct ip_header)); off += sizeof (struct ip_header); - memcpy (&source_ip, &ip_pkt.src_ip, sizeof (source_ip)); memcpy (&icmp_ttl, &buf[off], sizeof (struct icmp_ttl_exceeded_header)); off += sizeof (struct icmp_ttl_exceeded_header); if ((ICMP_TIME_EXCEEDED != icmp_ttl.type) || (0 != icmp_ttl.code)) @@ -403,6 +402,7 @@ 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))); -- 2.25.1