aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-14 21:59:21 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-14 21:59:21 +0000
commit9aaebf494d57c976311aeb1a94a976b61968b36a (patch)
treeb0a1ae8802be2d1250a797088e70f429766e0a65 /src/transport/plugin_transport_udp.c
parente8abceedf3a9c1e9f43d2e0aa277b5f0a1710792 (diff)
downloadgnunet-9aaebf494d57c976311aeb1a94a976b61968b36a.tar.gz
gnunet-9aaebf494d57c976311aeb1a94a976b61968b36a.zip
less casting
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r--src/transport/plugin_transport_udp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index e8a5b03a5..5be9bfb80 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -938,9 +938,9 @@ process_interfaces (void *cls,
938 else if (plugin->behind_nat == GNUNET_YES) /* We are behind NAT, but will advertise NAT and normal addresses */ 938 else if (plugin->behind_nat == GNUNET_YES) /* We are behind NAT, but will advertise NAT and normal addresses */
939 { 939 {
940 addr_nat = GNUNET_malloc(sizeof(t4)); 940 addr_nat = GNUNET_malloc(sizeof(t4));
941 t4.u_port = htons (DEFAULT_NAT_PORT);
941 memcpy(addr_nat, &t4, sizeof(t4)); 942 memcpy(addr_nat, &t4, sizeof(t4));
942 t4.u_port = plugin->port; 943 t4.u_port = plugin->port;
943 ((struct IPv4UdpAddress *)addr_nat)->u_port = htons(DEFAULT_NAT_PORT);
944 } 944 }
945 else 945 else
946 { 946 {
@@ -962,14 +962,14 @@ process_interfaces (void *cls,
962 add_to_address_list (plugin, &t6.ipv6_addr, sizeof (struct in6_addr)); 962 add_to_address_list (plugin, &t6.ipv6_addr, sizeof (struct in6_addr));
963 if ((plugin->behind_nat == GNUNET_YES) && (plugin->only_nat_addresses == GNUNET_YES)) 963 if ((plugin->behind_nat == GNUNET_YES) && (plugin->only_nat_addresses == GNUNET_YES))
964 { 964 {
965 t6.u6_port = htons (0); 965 t6.u6_port = htons (DEFAULT_NAT_PORT);
966 } 966 }
967 else if (plugin->behind_nat == GNUNET_YES) 967 else if (plugin->behind_nat == GNUNET_YES)
968 { 968 {
969 addr_nat = GNUNET_malloc(sizeof(t6)); 969 addr_nat = GNUNET_malloc(sizeof(t6));
970 t6.u6_port = htons (DEFAULT_NAT_PORT);
970 memcpy(addr_nat, &t6, sizeof(t6)); 971 memcpy(addr_nat, &t6, sizeof(t6));
971 t6.u6_port = plugin->port; 972 t6.u6_port = plugin->port;
972 ((struct IPv6UdpAddress *)addr_nat)->u6_port = htons(DEFAULT_NAT_PORT);
973 } 973 }
974 else 974 else
975 { 975 {