From: Christian Grothoff Date: Fri, 24 Feb 2012 21:24:04 +0000 (+0000) Subject: -fix X-Git-Tag: initial-import-from-subversion-38251~14650 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=73abffab0522085cc12ef2a29afdf669c6f54a41;p=oweals%2Fgnunet.git -fix --- diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index adabb70e5..3bf26d7b8 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c @@ -668,8 +668,9 @@ icmp_from_helper (const struct GNUNET_TUN_IcmpHeader *icmp, /* could be TCP or UDP, but both have the ports in the right place, so that doesn't matter here */ udp = (const struct GNUNET_TUN_UdpHeader *) &ipv4[1]; - source_port = ntohs (udp->source_port); - destination_port = ntohs (udp->destination_port); + /* swap ports, as they are from the original message */ + destination_port = ntohs (udp->source_port); + source_port = ntohs (udp->destination_port); /* throw away ICMP payload, won't be useful for the other side anyway */ pktlen = sizeof (struct GNUNET_TUN_IcmpHeader); break; @@ -701,8 +702,9 @@ icmp_from_helper (const struct GNUNET_TUN_IcmpHeader *icmp, /* could be TCP or UDP, but both have the ports in the right place, so that doesn't matter here */ udp = (const struct GNUNET_TUN_UdpHeader *) &ipv6[1]; - source_port = ntohs (udp->source_port); - destination_port = ntohs (udp->destination_port); + /* swap ports, as they are from the original message */ + destination_port = ntohs (udp->source_port); + source_port = ntohs (udp->destination_port); /* throw away ICMP payload, won't be useful for the other side anyway */ pktlen = sizeof (struct GNUNET_TUN_IcmpHeader); break;