aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp_nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_udp_nat.c')
-rw-r--r--src/transport/plugin_transport_udp_nat.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/transport/plugin_transport_udp_nat.c b/src/transport/plugin_transport_udp_nat.c
index 3733130e2..531f2ae10 100644
--- a/src/transport/plugin_transport_udp_nat.c
+++ b/src/transport/plugin_transport_udp_nat.c
@@ -627,6 +627,7 @@ run_gnunet_nat_client (struct Plugin *plugin, const char *addr, size_t addrlen)
627 * @param msgbuf_size the size of the msgbuf to send 627 * @param msgbuf_size the size of the msgbuf to send
628 * @param priority how important is the message (ignored by UDP) 628 * @param priority how important is the message (ignored by UDP)
629 * @param timeout when should we time out (give up) if we can not transmit? 629 * @param timeout when should we time out (give up) if we can not transmit?
630 * @param session identifier used for this session (can be NULL)
630 * @param addr the addr to send the message to, needs to be a sockaddr for us 631 * @param addr the addr to send the message to, needs to be a sockaddr for us
631 * @param addrlen the len of addr 632 * @param addrlen the len of addr
632 * @param force_address not used, we had better have an address to send to 633 * @param force_address not used, we had better have an address to send to
@@ -642,15 +643,16 @@ run_gnunet_nat_client (struct Plugin *plugin, const char *addr, size_t addrlen)
642 */ 643 */
643static ssize_t 644static ssize_t
644udp_nat_plugin_send (void *cls, 645udp_nat_plugin_send (void *cls,
645 const struct GNUNET_PeerIdentity *target, 646 const struct GNUNET_PeerIdentity *target,
646 const char *msgbuf, 647 const char *msgbuf,
647 size_t msgbuf_size, 648 size_t msgbuf_size,
648 unsigned int priority, 649 unsigned int priority,
649 struct GNUNET_TIME_Relative timeout, 650 struct GNUNET_TIME_Relative timeout,
650 const void *addr, 651 struct Session *session,
651 size_t addrlen, 652 const void *addr,
652 int force_address, 653 size_t addrlen,
653 GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls) 654 int force_address,
655 GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls)
654{ 656{
655 struct Plugin *plugin = cls; 657 struct Plugin *plugin = cls;
656 ssize_t sent; 658 ssize_t sent;
@@ -659,6 +661,7 @@ udp_nat_plugin_send (void *cls,
659 struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr; 661 struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr;
660 int other_peer_natd; 662 int other_peer_natd;
661 663
664 GNUNET_assert (NULL == session);
662 other_peer_natd = GNUNET_NO; 665 other_peer_natd = GNUNET_NO;
663 if ((sockaddr->sin_family == AF_INET) && (ntohs(sockaddr->sin_port) == 0)) 666 if ((sockaddr->sin_family == AF_INET) && (ntohs(sockaddr->sin_port) == 0))
664 { 667 {
@@ -1177,7 +1180,8 @@ udp_nat_demultiplexer(struct Plugin *plugin, struct GNUNET_PeerIdentity *sender,
1177 /* If we receive these just ignore! */ 1180 /* If we receive these just ignore! */
1178 break; 1181 break;
1179 default: 1182 default:
1180 plugin->env->receive (plugin->env->cls, sender, currhdr, UDP_DIRECT_DISTANCE, (char *)sender_addr, fromlen); 1183 plugin->env->receive (plugin->env->cls, sender, currhdr, UDP_DIRECT_DISTANCE,
1184 NULL, (char *)sender_addr, fromlen);
1181 } 1185 }
1182 1186
1183} 1187}