-fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2012 21:24:04 +0000 (21:24 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2012 21:24:04 +0000 (21:24 +0000)
src/exit/gnunet-daemon-exit.c

index adabb70e5bb1e03b2d478af3ea64105042dcb3ba..3bf26d7b8abb43e0a043a0aae57b73456aa1d582 100644 (file)
@@ -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;