gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12551 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r12551 - gnunet/src/transport
Date: Sat, 14 Aug 2010 23:59:21 +0200

Author: grothoff
Date: 2010-08-14 23:59:21 +0200 (Sat, 14 Aug 2010)
New Revision: 12551

Modified:
   gnunet/src/transport/plugin_transport_udp.c
Log:
less casting

Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2010-08-14 21:49:04 UTC (rev 
12550)
+++ gnunet/src/transport/plugin_transport_udp.c 2010-08-14 21:59:21 UTC (rev 
12551)
@@ -938,9 +938,9 @@
       else if (plugin->behind_nat == GNUNET_YES) /* We are behind NAT, but 
will advertise NAT and normal addresses */
         {
           addr_nat = GNUNET_malloc(sizeof(t4));
+          t4.u_port = htons (DEFAULT_NAT_PORT);
           memcpy(addr_nat, &t4, sizeof(t4));
           t4.u_port = plugin->port;
-          ((struct IPv4UdpAddress *)addr_nat)->u_port = 
htons(DEFAULT_NAT_PORT);
         }
       else
         {
@@ -962,14 +962,14 @@
       add_to_address_list (plugin, &t6.ipv6_addr, sizeof (struct in6_addr));
       if ((plugin->behind_nat == GNUNET_YES) && (plugin->only_nat_addresses == 
GNUNET_YES))
         {
-          t6.u6_port = htons (0);
+          t6.u6_port = htons (DEFAULT_NAT_PORT);
         }
       else if (plugin->behind_nat == GNUNET_YES)
         {
           addr_nat = GNUNET_malloc(sizeof(t6));
+          t6.u6_port = htons (DEFAULT_NAT_PORT);
           memcpy(addr_nat, &t6, sizeof(t6));
           t6.u6_port = plugin->port;
-          ((struct IPv6UdpAddress *)addr_nat)->u6_port = 
htons(DEFAULT_NAT_PORT);
         }
       else
         {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]