From 73abffab0522085cc12ef2a29afdf669c6f54a41 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 24 Feb 2012 21:24:04 +0000 Subject: [PATCH] -fix --- src/exit/gnunet-daemon-exit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; -- 2.25.1