#endif
if (fc->client_to_service_task != GNUNET_SCHEDULER_NO_TASK)
{
- GNUNET_SCHEDULER_cancel ( fc->client_to_service_task);
+ GNUNET_SCHEDULER_cancel (fc->client_to_service_task);
fc->client_to_service_task = GNUNET_SCHEDULER_NO_TASK;
}
if (fc->armClientSocket != NULL)
"Closing forwarding connection (done with both directions)\n");
#endif
if (fc->start_task != GNUNET_SCHEDULER_NO_TASK)
- GNUNET_SCHEDULER_cancel ( fc->start_task);
+ GNUNET_SCHEDULER_cancel (fc->start_task);
if ( (NULL != fc->armClientSocket) &&
(GNUNET_SYSERR ==
GNUNET_NETWORK_socket_close (fc->armClientSocket)) )
fc->armClientSocket))
{
fc->client_to_service_task =
- GNUNET_SCHEDULER_add_read_net (
- GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
fc->armClientSocket,
&receiveFromClient, fc);
return;
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY))
{
- GNUNET_NETWORK_socket_close (sli->listeningSocket);
+ GNUNET_assert (GNUNET_OK == GNUNET_NETWORK_socket_close (sli->listeningSocket));
closeClientAndServiceSockets (fc, REASON_ERROR);
GNUNET_free (sli);
return;
addrlen);
serviceListeningInfo->service_addr_len = addrlen;
serviceListeningInfo->listeningSocket = sock;
+ serviceListeningInfo->fc = fc;
serviceListeningInfo->acceptTask =
GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
serviceListeningInfo->listeningSocket,
}
switch (fc->listen_info->service_addr->sa_family)
{
+ case AF_UNSPEC:
+ GNUNET_break (0);
+ closeClientAndServiceSockets (fc, REASON_ERROR);
+ return;
case AF_INET:
v4 = (const struct sockaddr_in *) fc->listen_info->service_addr;
inet_ntop (fc->listen_info->service_addr->sa_family,
if ( (strncmp (listen_address, "[::]:", 5) == 0) || (strncmp (listen_address, "::", 2) == 0) )
{
memset (&target_ipv6, 0, sizeof (target_ipv6));
- inet_pton (AF_INET6, "::1", &target_ipv6.sin6_addr);
+ target_ipv6.sin6_addr = in6addr_loopback;
target_ipv6.sin6_family = AF_INET6;
target_ipv6.sin6_port = v6->sin6_port;
v6 = &target_ipv6;
GNUNET_free (pos->listeningSocket); /* deliberately no closing! */
GNUNET_free (pos->service_addr);
GNUNET_free (pos->serviceName);
- GNUNET_SCHEDULER_cancel ( pos->acceptTask);
+ GNUNET_SCHEDULER_cancel (pos->acceptTask);
GNUNET_CONTAINER_DLL_remove (serviceListeningInfoList_head,
serviceListeningInfoList_tail,
pos);
sock = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0);
break;
case AF_UNIX:
+ if (strcmp(GNUNET_a2s (sa, addr_len), "@") == 0) /* Do not bind to blank UNIX path! */
+ return;
sock = GNUNET_NETWORK_socket_create (PF_UNIX, SOCK_STREAM, 0);
break;
default:
if (GNUNET_NETWORK_socket_bind
(sock, (const struct sockaddr *) sa, addr_len) != GNUNET_OK)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Unable to bind listening socket for service `%s' to address `%s': %s\n"),
serviceName,
GNUNET_a2s (sa, addr_len),