aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp.c
diff options
context:
space:
mode:
authorBruno Cabral <bcabral@uw.edu>2015-07-18 19:15:51 +0000
committerBruno Cabral <bcabral@uw.edu>2015-07-18 19:15:51 +0000
commitfaf6cdf7e592414f041d486bf620967817485435 (patch)
treed5707ff9ca5dee5846d9592094c39a6a73ec77e6 /src/transport/plugin_transport_udp.c
parent6fc671e8b19c77baca0cefee1eee5dea722f5d2c (diff)
downloadgnunet-faf6cdf7e592414f041d486bf620967817485435.tar.gz
gnunet-faf6cdf7e592414f041d486bf620967817485435.zip
Get STUN to work with UDP plugin
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r--src/transport/plugin_transport_udp.c14
1 files changed, 13 insertions, 1 deletions
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