From: Christian Grothoff Date: Thu, 4 Feb 2010 14:15:59 +0000 (+0000) Subject: client X-Git-Tag: initial-import-from-subversion-38251~22794 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d81bf5ffd39cf2b0c6f1cc5c1ae643d34fd0378;p=oweals%2Fgnunet.git client --- diff --git a/src/transport/gnunet-nat-client.c b/src/transport/gnunet-nat-client.c index c4b327aac..ada7b3b18 100644 --- a/src/transport/gnunet-nat-client.c +++ b/src/transport/gnunet-nat-client.c @@ -121,6 +121,8 @@ static int rawsock; static struct in_addr dummy; +static struct in_addr target; + /** * create a random port number that is not totally @@ -403,6 +405,7 @@ process_icmp_response (const struct in_addr *my_ip, } else { + send_icmp (my_ip, &target, reply_magic, my_magic); printf ("%s:%u\n", inet_ntop (AF_INET, &sip, @@ -479,7 +482,6 @@ make_raw_socket () int main (int argc, char *const *argv) { - struct in_addr target; struct in_addr external; unsigned int i; unsigned int pos; diff --git a/src/transport/gnunet-nat-server.c b/src/transport/gnunet-nat-server.c index 77b73b708..0bf398231 100644 --- a/src/transport/gnunet-nat-server.c +++ b/src/transport/gnunet-nat-server.c @@ -376,8 +376,8 @@ process_icmp_response (const struct in_addr *my_ip, return; } memcpy(&sip, &ip_pkt.src_ip, sizeof (sip)); - my_magic = ntohs (udp_pkt.checksum_aka_my_magic); - reply_magic = ntohs (udp_pkt.mlen_aka_reply_port_magic); + reply_magic = ntohs (udp_pkt.checksum_aka_my_magic); + my_magic = ntohs (udp_pkt.mlen_aka_reply_port_magic); fprintf (stderr, "Received ICMP from `%s' with hints %u and %u\n", inet_ntop (AF_INET,