GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket");
GNUNET_free ((struct sockaddr *) addr);
return;
- }
+ }
if (GNUNET_OK != GNUNET_NETWORK_socket_bind (listen_sock, addr, in_len))
{
GNUNET_NETWORK_socket_close (listen_sock);
listen_sock = NULL;
return;
- }
+ }
if (GNUNET_OK !=
GNUNET_NETWORK_socket_listen (listen_sock,
"listen");
GNUNET_NETWORK_socket_close (listen_sock);
listen_sock = NULL;
- }
+ return;
+ }
/* We might have bound to port 0, allowing the OS to figure it out;
thus, get the real IN-address from the socket */
NULL /* FIXME: support reversal: #5529 */,
NULL /* closure */);
+
if (NULL == nat)
{
GNUNET_break (0);
//TODO Remove this, if we like to handle more then one address.
if (NULL != resolve_request_handle)
GNUNET_RESOLVER_request_cancel (resolve_request_handle);
+
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"init_own finished %s\n",
GNUNET_a2s (addr, in_len));
{
struct sockaddr_in *v4;
struct sockaddr_in6 *v6;
+ struct sockaddr *in;
if (NULL != addr)
{
if (AF_INET == addr->sa_family)
{
v4 = (struct sockaddr_in *) addr;
- v4->sin_port = htons ((uint16_t) port_global);
+ /* v4->sin_port = htons ((uint16_t) port_global);*/
+ in = tcp_address_to_sockaddr_numeric_v4 (&in_len, *v4, port_global);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"ipv4 \n");
}else if (AF_INET6 == addr->sa_family)
{
- v6 = (struct sockaddr_in6 *) addr;
- v6->sin6_port = htons ((uint16_t) port_global);
+ v6 = (struct sockaddr_in6 *) addr;
+ /*v6->sin6_port = htons ((uint16_t) port_global);*/
+ in = tcp_address_to_sockaddr_numeric_v6 (&in_len, *v6, port_global);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"ipv6 \n");
}else
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Address is NULL. This might be an error or the resolver finished resolving.\n");
- }
+ }
init_socket (cls,
- addr,
+ in,
in_len);
}