diff options
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 5 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 14 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.h | 5 |
4 files changed, 22 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index b4130f945..0000a604d 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -2761,7 +2761,7 @@ server_start_report_addresses (struct HTTP_Server_Plugin *plugin) | |||
2761 | plugin->port, | 2761 | plugin->port, |
2762 | (unsigned int) res, | 2762 | (unsigned int) res, |
2763 | (const struct sockaddr **) addrs, addrlens, | 2763 | (const struct sockaddr **) addrs, addrlens, |
2764 | &server_nat_port_map_callback, NULL, plugin); | 2764 | &server_nat_port_map_callback, NULL, plugin, NULL); |
2765 | while (res > 0) | 2765 | while (res > 0) |
2766 | { | 2766 | { |
2767 | res--; | 2767 | res--; |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index ec66a4388..b4bcde60f 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -2960,7 +2960,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
2960 | (const struct sockaddr **) addrs, addrlens, | 2960 | (const struct sockaddr **) addrs, addrlens, |
2961 | &tcp_nat_port_map_callback, | 2961 | &tcp_nat_port_map_callback, |
2962 | &try_connection_reversal, | 2962 | &try_connection_reversal, |
2963 | plugin); | 2963 | plugin, NULL); |
2964 | for (ret = ret_s -1; ret >= 0; ret--) | 2964 | for (ret = ret_s -1; ret >= 0; ret--) |
2965 | GNUNET_free (addrs[ret]); | 2965 | GNUNET_free (addrs[ret]); |
2966 | GNUNET_free_non_null (addrs); | 2966 | GNUNET_free_non_null (addrs); |
@@ -2976,7 +2976,8 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
2976 | NULL, | 2976 | NULL, |
2977 | NULL, | 2977 | NULL, |
2978 | &try_connection_reversal, | 2978 | &try_connection_reversal, |
2979 | plugin); | 2979 | plugin, |
2980 | NULL); | ||
2980 | } | 2981 | } |
2981 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); | 2982 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
2982 | api->cls = plugin; | 2983 | api->cls = plugin; |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 91839bbff..d031e6008 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -2854,6 +2854,13 @@ udp_select_read (struct Plugin *plugin, | |||
2854 | /* Connection failure or something. Not a protocol violation. */ | 2854 | /* Connection failure or something. Not a protocol violation. */ |
2855 | return; | 2855 | return; |
2856 | } | 2856 | } |
2857 | |||
2858 | |||
2859 | /* PROCESS STUN PACKET */ | ||
2860 | if(GNUNET_NAT_try_decode_stun_packet(plugin->nat,(uint8_t *)buf, size )) | ||
2861 | return; | ||
2862 | |||
2863 | |||
2857 | if (size < sizeof(struct GNUNET_MessageHeader)) | 2864 | if (size < sizeof(struct GNUNET_MessageHeader)) |
2858 | { | 2865 | { |
2859 | LOG (GNUNET_ERROR_TYPE_WARNING, | 2866 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -2866,6 +2873,10 @@ udp_select_read (struct Plugin *plugin, | |||
2866 | GNUNET_break_op (0); | 2873 | GNUNET_break_op (0); |
2867 | return; | 2874 | return; |
2868 | } | 2875 | } |
2876 | |||
2877 | |||
2878 | |||
2879 | |||
2869 | msg = (const struct GNUNET_MessageHeader *) buf; | 2880 | msg = (const struct GNUNET_MessageHeader *) buf; |
2870 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2881 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2871 | "UDP received %u-byte message from `%s' type %u\n", | 2882 | "UDP received %u-byte message from `%s' type %u\n", |
@@ -3533,7 +3544,8 @@ setup_sockets (struct Plugin *plugin, | |||
3533 | addrlens, | 3544 | addrlens, |
3534 | &udp_nat_port_map_callback, | 3545 | &udp_nat_port_map_callback, |
3535 | NULL, | 3546 | NULL, |
3536 | plugin); | 3547 | plugin, |
3548 | plugin->sockv4); | ||
3537 | return sockets_created; | 3549 | return sockets_created; |
3538 | } | 3550 | } |
3539 | 3551 | ||
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h index 603e13e1a..5f8366636 100644 --- a/src/transport/plugin_transport_udp.h +++ b/src/transport/plugin_transport_udp.h | |||
@@ -190,6 +190,11 @@ struct Plugin | |||
190 | struct GNUNET_NAT_Handle *nat; | 190 | struct GNUNET_NAT_Handle *nat; |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * Handle to NAT traversal support. | ||
194 | */ | ||
195 | struct GNUNET_NAT_STUN_Handle *stun; | ||
196 | |||
197 | /** | ||
193 | * The read socket for IPv4 | 198 | * The read socket for IPv4 |
194 | */ | 199 | */ |
195 | struct GNUNET_NETWORK_Handle *sockv4; | 200 | struct GNUNET_NETWORK_Handle *sockv4; |