switch (sa->sa_family)
{
case AF_INET:
+ if (NULL == plugin->sockv4)
+ return 0;
sent =
GNUNET_NETWORK_socket_sendto (plugin->sockv4,
msg,
slen = sizeof (struct sockaddr_in));
break;
case AF_INET6:
+ if (NULL == plugin->sockv6)
+ return 0;
sent =
GNUNET_NETWORK_socket_sendto (plugin->sockv6,
msg,
switch (addrlen)
{
case sizeof(struct IPv4UdpAddress):
+ if (NULL == plugin->sockv4)
+ {
+ cont (cont_cls, target, GNUNET_SYSERR);
+ return 0;
+ }
t4 = addr;
peer_session = GNUNET_malloc (sizeof (struct PeerSession) + sizeof (struct sockaddr_in));
v4 = (struct sockaddr_in*) &peer_session[1];
v4->sin_addr.s_addr = t4->ipv4_addr;
break;
case sizeof(struct IPv6UdpAddress):
+ if (NULL == plugin->sockv6)
+ {
+ cont (cont_cls, target, GNUNET_SYSERR);
+ return 0;
+ }
t6 = addr;
peer_session = GNUNET_malloc (sizeof (struct PeerSession) + sizeof (struct sockaddr_in6));
v6 = (struct sockaddr_in6*) &peer_session[1];
GNUNET_free_non_null (plugin->bind4_address);
GNUNET_free (plugin->bind6_address);
GNUNET_free (plugin);
+ GNUNET_free (api);
return NULL;
}
}