diff options
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 4f7b57641..01a4eade8 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1521,7 +1521,7 @@ tcp_plugin_get_session (void *cls, | |||
1521 | const struct IPv4TcpAddress *t4; | 1521 | const struct IPv4TcpAddress *t4; |
1522 | const struct IPv6TcpAddress *t6; | 1522 | const struct IPv6TcpAddress *t6; |
1523 | unsigned int options; | 1523 | unsigned int options; |
1524 | struct GNUNET_ATS_Information ats; | 1524 | enum GNUNET_ATS_Network_Type net_type; |
1525 | unsigned int is_natd = GNUNET_NO; | 1525 | unsigned int is_natd = GNUNET_NO; |
1526 | size_t addrlen; | 1526 | size_t addrlen; |
1527 | #ifdef TCP_STEALTH | 1527 | #ifdef TCP_STEALTH |
@@ -1612,7 +1612,8 @@ tcp_plugin_get_session (void *cls, | |||
1612 | return NULL; | 1612 | return NULL; |
1613 | } | 1613 | } |
1614 | 1614 | ||
1615 | ats = plugin->env->get_address_type (plugin->env->cls, sb, sbs); | 1615 | net_type = plugin->env->get_address_type (plugin->env->cls, sb, sbs); |
1616 | |||
1616 | 1617 | ||
1617 | if ((is_natd == GNUNET_YES) && (addrlen == sizeof(struct IPv6TcpAddress))) | 1618 | if ((is_natd == GNUNET_YES) && (addrlen == sizeof(struct IPv6TcpAddress))) |
1618 | { | 1619 | { |
@@ -1645,7 +1646,7 @@ tcp_plugin_get_session (void *cls, | |||
1645 | address, | 1646 | address, |
1646 | NULL, | 1647 | NULL, |
1647 | GNUNET_YES); | 1648 | GNUNET_YES); |
1648 | session->ats_address_network_type = (enum GNUNET_ATS_Network_Type) ntohl (ats.value); | 1649 | session->ats_address_network_type = net_type; |
1649 | GNUNET_break (session->ats_address_network_type != GNUNET_ATS_NET_UNSPECIFIED); | 1650 | GNUNET_break (session->ats_address_network_type != GNUNET_ATS_NET_UNSPECIFIED); |
1650 | session->nat_connection_timeout = GNUNET_SCHEDULER_add_delayed (NAT_TIMEOUT, | 1651 | session->nat_connection_timeout = GNUNET_SCHEDULER_add_delayed (NAT_TIMEOUT, |
1651 | &nat_connect_timeout, | 1652 | &nat_connect_timeout, |
@@ -1742,7 +1743,7 @@ tcp_plugin_get_session (void *cls, | |||
1742 | address, | 1743 | address, |
1743 | GNUNET_SERVER_connect_socket (plugin->server, sa), | 1744 | GNUNET_SERVER_connect_socket (plugin->server, sa), |
1744 | GNUNET_NO); | 1745 | GNUNET_NO); |
1745 | session->ats_address_network_type = (enum GNUNET_ATS_Network_Type) ntohl (ats.value); | 1746 | session->ats_address_network_type = net_type; |
1746 | GNUNET_break (session->ats_address_network_type != GNUNET_ATS_NET_UNSPECIFIED); | 1747 | GNUNET_break (session->ats_address_network_type != GNUNET_ATS_NET_UNSPECIFIED); |
1747 | GNUNET_SERVER_client_set_user_context(session->client, session); | 1748 | GNUNET_SERVER_client_set_user_context(session->client, session); |
1748 | GNUNET_CONTAINER_multipeermap_put (plugin->sessionmap, | 1749 | GNUNET_CONTAINER_multipeermap_put (plugin->sessionmap, |
@@ -2333,8 +2334,9 @@ handle_tcp_welcome (void *cls, | |||
2333 | } | 2334 | } |
2334 | session = create_session (plugin, address, client, GNUNET_NO); | 2335 | session = create_session (plugin, address, client, GNUNET_NO); |
2335 | GNUNET_HELLO_address_free (address); | 2336 | GNUNET_HELLO_address_free (address); |
2336 | ats = plugin->env->get_address_type (plugin->env->cls, vaddr, alen); | 2337 | session->ats_address_network_type = plugin->env->get_address_type (plugin->env->cls, vaddr, alen); |
2337 | session->ats_address_network_type = (enum GNUNET_ATS_Network_Type) ntohl (ats.value); | 2338 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); |
2339 | ats.value = htonl (session->ats_address_network_type); | ||
2338 | LOG(GNUNET_ERROR_TYPE_DEBUG, | 2340 | LOG(GNUNET_ERROR_TYPE_DEBUG, |
2339 | "Creating new%s session %p for peer `%s' client %p \n", | 2341 | "Creating new%s session %p for peer `%s' client %p \n", |
2340 | GNUNET_HELLO_address_check_option (session->address, | 2342 | GNUNET_HELLO_address_check_option (session->address, |