From faf6cdf7e592414f041d486bf620967817485435 Mon Sep 17 00:00:00 2001 From: Bruno Cabral Date: Sat, 18 Jul 2015 19:15:51 +0000 Subject: Get STUN to work with UDP plugin --- src/transport/plugin_transport_udp.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/transport/plugin_transport_udp.c') 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, /* Connection failure or something. Not a protocol violation. */ return; } + + + /* PROCESS STUN PACKET */ + if(GNUNET_NAT_try_decode_stun_packet(plugin->nat,(uint8_t *)buf, size )) + return; + + if (size < sizeof(struct GNUNET_MessageHeader)) { LOG (GNUNET_ERROR_TYPE_WARNING, @@ -2866,6 +2873,10 @@ udp_select_read (struct Plugin *plugin, GNUNET_break_op (0); return; } + + + + msg = (const struct GNUNET_MessageHeader *) buf; LOG (GNUNET_ERROR_TYPE_DEBUG, "UDP received %u-byte message from `%s' type %u\n", @@ -3533,7 +3544,8 @@ setup_sockets (struct Plugin *plugin, addrlens, &udp_nat_port_map_callback, NULL, - plugin); + plugin, + plugin->sockv4); return sockets_created; } -- cgit v1.2.3