From: Christian Grothoff Date: Sat, 17 Oct 2009 20:47:30 +0000 (+0000) Subject: making flags, set non-blocking and set-inheritable internal issues of network.c X-Git-Tag: initial-import-from-subversion-38251~23355 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=32219472d9ad7f60a82b3c68cd61115bfc1e3ad7;p=oweals%2Fgnunet.git making flags, set non-blocking and set-inheritable internal issues of network.c --- diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index e4ba55854..513787e08 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -51,8 +51,11 @@ struct GNUNET_NETWORK_FDSet; #include "gnunet_disk_lib.h" #include "gnunet_time_lib.h" + /** - * accept a new connection on a socket + * Accept a new connection on a socket. Configure it for non-blocking + * IO and mark it as non-inheritable to child processes (set the + * close-on-exec flag). * * @param desc bound socket * @param address address of the connecting peer, may be NULL @@ -64,17 +67,6 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, struct sockaddr *address, socklen_t *address_len); -/** - * Make a non-inheritable to child processes (sets the - * close-on-exec flag). - * - * @param h the socket to make non-inheritable - * @return GNUNET_OK on success, GNUNET_SYSERR otherwise - * @warning Not implemented on Windows - */ -int -GNUNET_NETWORK_socket_set_inheritable (const struct GNUNET_NETWORK_Handle - *h); /** * Bind to a connected socket @@ -88,7 +80,7 @@ int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, const struct sockaddr *address, socklen_t address_len); /** - * Close a socket + * Close a socket. * * @param desc socket to close * @return GNUNET_OK on success, GNUNET_SYSERR otherwise @@ -132,16 +124,15 @@ int GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, i int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, int backlog); /** - * Read data from a connected socket + * Read data from a connected socket (always non-blocking). * * @param desc socket * @param buffer buffer * @param length length of buffer - * @param flags type of message reception * @return number of bytes read */ ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, void *buffer, - size_t length, int flags); + size_t length); /** * Check if sockets meet certain conditions @@ -155,38 +146,32 @@ int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, struct GNUNET_NETWORK_FDSet *wfds, struct GNUNET_NETWORK_FDSet *efds, struct GNUNET_TIME_Relative timeout); -/** - * Set if a socket should use blocking or non-blocking IO. - * @param fd socket - * @param doBlock blocking mode - * @return GNUNET_OK on success, GNUNET_SYSERR on error - */ -int GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, - int doBlock); + /** - * Send data + * Send data (always non-blocking). + * * @param desc socket * @param buffer data to send * @param length size of the buffer - * @param flags type of message transmission * @return number of bytes sent, GNUNET_SYSERR on error */ ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, - const void *buffer, size_t length, int flags); + const void *buffer, size_t length); /** - * Send data + * Send data to a particular destination (always non-blocking). + * This function only works for UDP sockets. + * * @param desc socket * @param message data to send * @param length size of the data - * @param flags type of message transmission * @param dest_addr destination address * @param dest_len length of address * @return number of bytes sent, GNUNET_SYSERR on error */ ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, - const void *message, size_t length, int flags, + const void *message, size_t length, const struct sockaddr *dest_addr, socklen_t dest_len); @@ -210,14 +195,18 @@ int GNUNET_NETWORK_socket_setsockopt(struct GNUNET_NETWORK_Handle *fd, int level */ int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how); + /** - * Create a new socket + * Create a new socket. Configure it for non-blocking IO and + * mark it as non-inheritable to child processes (set the + * close-on-exec flag). + * * @param domain domain of the socket * @param type socket type * @param protocol network protocol * @return new socket, NULL on error */ -struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_socket (int domain, int type, int protocol); +struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, int type, int protocol); /** * Reset FD set (clears all file descriptors). diff --git a/src/util/connection.c b/src/util/connection.c index 1e2f1fca8..ad2bf14c0 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -342,11 +342,6 @@ GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "accept"); return NULL; } -#ifndef MINGW - if (GNUNET_OK != GNUNET_NETWORK_socket_set_inheritable (sock)) - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "fcntl"); -#endif if (addrlen > sizeof (addr)) { GNUNET_break (0); @@ -797,25 +792,12 @@ try_connect_using_address (void *cls, GNUNET_free (ap); return; /* not supported by us */ } - ap->sock = GNUNET_NETWORK_socket_socket (ap->addr->sa_family, SOCK_STREAM, 0); + ap->sock = GNUNET_NETWORK_socket_create (ap->addr->sa_family, SOCK_STREAM, 0); if (ap->sock == NULL) { GNUNET_free (ap); return; /* not supported by OS */ } -#ifndef MINGW - if (GNUNET_OK != GNUNET_NETWORK_socket_set_inheritable (ap->sock)) - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "GNUNET_NETWORK_socket_set_inheritable"); -#endif - if (GNUNET_SYSERR == GNUNET_NETWORK_socket_set_blocking (ap->sock, GNUNET_NO)) - { - /* we might want to treat this one as fatal... */ - GNUNET_break (0); - GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ap->sock)); - GNUNET_free (ap); - return; - } #if DEBUG_CONNECTION GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Trying to connect to `%s' (%p)\n"), @@ -932,27 +914,13 @@ GNUNET_CONNECTION_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle struct GNUNET_NETWORK_Handle *s; struct GNUNET_CONNECTION_Handle *ret; - s = GNUNET_NETWORK_socket_socket (af_family, SOCK_STREAM, 0); + s = GNUNET_NETWORK_socket_create (af_family, SOCK_STREAM, 0); if (s == NULL) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, "socket"); return NULL; } -#ifndef MINGW -#if 0 - // FIXME NILS - if (0 != fcntl (s, F_SETFD, fcntl (s, F_GETFD) | FD_CLOEXEC)) - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "fcntl"); -#endif -#endif - if (GNUNET_SYSERR == GNUNET_NETWORK_socket_set_blocking (s, GNUNET_NO)) - { - /* we'll treat this one as fatal */ - GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s)); - return NULL; - } if ((GNUNET_OK != GNUNET_NETWORK_socket_connect (s, serv_addr, addrlen)) && (errno != EINPROGRESS)) { /* maybe refused / unsupported address, try next */ @@ -1093,14 +1061,7 @@ receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } GNUNET_assert (GNUNET_NETWORK_fdset_isset (tc->read_ready, sh->sock)); RETRY: - ret = GNUNET_NETWORK_socket_recv (sh->sock, buffer, sh->max, -#ifndef MINGW - // FIXME MINGW - MSG_DONTWAIT -#else - 0 -#endif - ); + ret = GNUNET_NETWORK_socket_recv (sh->sock, buffer, sh->max); if (ret == -1) { if (errno == EINTR) @@ -1418,14 +1379,7 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) RETRY: ret = GNUNET_NETWORK_socket_send (sock->sock, &sock->write_buffer[sock->write_buffer_pos], - have, -#ifndef MINGW - // FIXME NILS - MSG_DONTWAIT | MSG_NOSIGNAL -#else - 0 -#endif - ); + have); if (ret == -1) { if (errno == EINTR) diff --git a/src/util/network.c b/src/util/network.c index 8bdace580..9a38dc098 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -55,6 +55,75 @@ struct GNUNET_NETWORK_FDSet #define FD_COPY(s, d) (memcpy ((d), (s), sizeof (fd_set))) #endif + + +/** + * Set if a socket should use blocking or non-blocking IO. + * @param fd socket + * @param doBlock blocking mode + * @return GNUNET_OK on success, GNUNET_SYSERR on error + */ +static int +socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, + int doBlock) +{ +#if MINGW + u_long mode; + mode = !doBlock; + if (ioctlsocket (fd->fd, FIONBIO, &mode) == SOCKET_ERROR) + { + SetErrnoFromWinsockError (WSAGetLastError ()); + GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "ioctlsocket"); + return GNUNET_SYSERR; + } + return GNUNET_OK; + +#else + /* not MINGW */ + int flags = fcntl (fd->fd, F_GETFL); + if (flags == -1) + { + GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "fcntl"); + return GNUNET_SYSERR; + } + if (doBlock) + flags &= ~O_NONBLOCK; + else + flags |= O_NONBLOCK; + if (0 != fcntl (fd->fd, F_SETFL, flags)) + { + GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "fcntl"); + return GNUNET_SYSERR; + } + return GNUNET_OK; +#endif +} + + +#ifndef MINGW +/** + * Make a non-inheritable to child processes + * + * @param h the socket to make non-inheritable + * @return GNUNET_OK on success, GNUNET_SYSERR otherwise + * @warning Not implemented on Windows + */ +static int +socket_set_inheritable (const struct GNUNET_NETWORK_Handle + *h) +{ + int i; + + i = fcntl (h->fd, F_GETFD); + if (i == (i | FD_CLOEXEC)) + return GNUNET_OK; + return (fcntl (h->fd, F_SETFD, i | FD_CLOEXEC) == 0) + ? GNUNET_OK : GNUNET_SYSERR; +} +#endif + + + /** * accept a new connection on a socket * @@ -88,6 +157,18 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, errno = EMFILE; return NULL; } +#endif + if (GNUNET_SYSERR == socket_set_blocking (ret, GNUNET_NO)) + { + /* we might want to treat this one as fatal... */ + GNUNET_break (0); + GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret)); + return NULL; + } +#ifndef MINGW + if (GNUNET_OK != socket_set_inheritable (ret)) + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, + "socket_set_inheritable"); #endif return ret; } @@ -114,47 +195,6 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, return ret == 0 ? GNUNET_OK : GNUNET_SYSERR; } -/** - * Set if a socket should use blocking or non-blocking IO. - * @param fd socket - * @param doBlock blocking mode - * @return GNUNET_OK on success, GNUNET_SYSERR on error - */ -int -GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, - int doBlock) -{ -#if MINGW - u_long mode; - mode = !doBlock; - if (ioctlsocket (fd->fd, FIONBIO, &mode) == SOCKET_ERROR) - { - SetErrnoFromWinsockError (WSAGetLastError ()); - GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "ioctlsocket"); - return GNUNET_SYSERR; - } - return GNUNET_OK; - -#else - /* not MINGW */ - int flags = fcntl (fd->fd, F_GETFL); - if (flags == -1) - { - GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "fcntl"); - return GNUNET_SYSERR; - } - if (doBlock) - flags &= ~O_NONBLOCK; - else - flags |= O_NONBLOCK; - if (0 != fcntl (fd->fd, F_SETFL, flags)) - { - GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "fcntl"); - return GNUNET_SYSERR; - } - return GNUNET_OK; -#endif -} /** * Close a socket @@ -207,6 +247,7 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, /** * Get socket options + * * @param desc socket * @param level protocol level of the option * @param optname identifier of the option @@ -253,18 +294,22 @@ GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, } /** - * Read data from a connected socket + * Read data from a connected socket (always non-blocking). * @param desc socket * @param buffer buffer * @param length length of buffer - * @param flags type of message reception */ ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle * desc, - void *buffer, size_t length, int flags) + void *buffer, size_t length) { int ret; + int flags; + flags = 0; +#ifdef MSG_DONTWAIT + flags |= MSG_DONTWAIT; +#endif ret = recv (desc->fd, buffer, length, flags); #ifdef MINGW if (SOCKET_ERROR == ret) @@ -275,19 +320,27 @@ GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle * desc, } /** - * Send data + * Send data (always non-blocking). + * * @param desc socket * @param buffer data to send * @param length size of the buffer - * @param flags type of message transmission * @return number of bytes sent, GNUNET_SYSERR on error */ ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle * desc, - const void *buffer, size_t length, int flags) + const void *buffer, size_t length) { int ret; + int flags; + flags = 0; +#ifdef MSG_DONTWAIT + flags |= MSG_DONTWAIT; +#endif +#ifdef MSG_NOSIGNAL + flags |= MSG_NOSIGNAL; +#endif ret = send (desc->fd, buffer, length, flags); #ifdef MINGW if (SOCKET_ERROR == ret) @@ -297,24 +350,34 @@ GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle * desc, return ret; } + /** - * Send data + * Send data to a particular destination (always non-blocking). + * This function only works for UDP sockets. + * * @param desc socket * @param message data to send * @param length size of the data - * @param flags type of message transmission * @param dest_addr destination address * @param dest_len length of address * @return number of bytes sent, GNUNET_SYSERR on error */ ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle * desc, - const void *message, size_t length, int flags, + const void *message, size_t length, const struct sockaddr * dest_addr, socklen_t dest_len) { int ret; + int flags; + flags = 0; +#ifdef MSG_DONTWAIT + flags |= MSG_DONTWAIT; +#endif +#ifdef MSG_NOSIGNAL + flags |= MSG_NOSIGNAL; +#endif ret = sendto (desc->fd, message, length, flags, dest_addr, dest_len); #ifdef MINGW if (SOCKET_ERROR == ret) @@ -350,15 +413,20 @@ GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, return ret == 0 ? GNUNET_OK : GNUNET_SYSERR; } + + /** - * Create a new socket + * Create a new socket. Configure it for non-blocking IO and + * mark it as non-inheritable to child processes (set the + * close-on-exec flag). + * * @param domain domain of the socket * @param type socket type * @param protocol network protocol * @return new socket, NULL on error */ struct GNUNET_NETWORK_Handle * -GNUNET_NETWORK_socket_socket (int domain, int type, int protocol) +GNUNET_NETWORK_socket_create (int domain, int type, int protocol) { struct GNUNET_NETWORK_Handle *ret; @@ -381,6 +449,20 @@ GNUNET_NETWORK_socket_socket (int domain, int type, int protocol) return NULL; } #endif + + if (GNUNET_SYSERR == socket_set_blocking (ret, GNUNET_NO)) + { + /* we might want to treat this one as fatal... */ + GNUNET_break (0); + GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret)); + return NULL; + } +#ifndef MINGW + if (GNUNET_OK != socket_set_inheritable (ret)) + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, + "socket_set_inheritable"); +#endif + return ret; } @@ -405,31 +487,6 @@ GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, return ret == 0 ? GNUNET_OK : GNUNET_SYSERR; } -/** - * Make a non-inheritable to child processes - * - * @param h the socket to make non-inheritable - * @return GNUNET_OK on success, GNUNET_SYSERR otherwise - * @warning Not implemented on Windows - */ -int -GNUNET_NETWORK_socket_set_inheritable (const struct GNUNET_NETWORK_Handle - *h) -{ -#ifdef MINGW - errno = ENOSYS; - return GNUNET_SYSERR; -#else - int i; - - i = fcntl (h->fd, F_GETFD); - if (i == (i | FD_CLOEXEC)) - return GNUNET_OK; - return (fcntl (h->fd, F_SETFD, i | FD_CLOEXEC) == 0) - ? GNUNET_OK : GNUNET_SYSERR; -#endif -} - /** * Reset FD set diff --git a/src/util/server.c b/src/util/server.c index 7214b1939..646299718 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -382,17 +382,12 @@ open_listen_socket (const struct sockaddr *serverAddr, socklen_t socklen) GNUNET_break (0); return NULL; } - sock = GNUNET_NETWORK_socket_socket (serverAddr->sa_family, SOCK_STREAM, 0); + sock = GNUNET_NETWORK_socket_create (serverAddr->sa_family, SOCK_STREAM, 0); if (NULL == sock) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket"); return NULL; } -#ifndef MINGW - if (GNUNET_OK != GNUNET_NETWORK_socket_set_inheritable (sock)) - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "fcntl"); -#endif if (GNUNET_NETWORK_socket_setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "setsockopt"); diff --git a/src/util/service.c b/src/util/service.c index 36a1f05b1..ee15da268 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -815,7 +815,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) if (!disablev6) { /* probe IPv6 support */ - desc = GNUNET_NETWORK_socket_socket (PF_INET6, SOCK_STREAM, 0); + desc = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0); if (NULL == desc) { if ((errno == ENOBUFS) || diff --git a/src/util/test_connection.c b/src/util/test_connection.c index 549b3b840..30eee76ce 100644 --- a/src/util/test_connection.c +++ b/src/util/test_connection.c @@ -62,7 +62,7 @@ open_listen_socket () #endif sa.sin_port = htons (PORT); sa.sin_family = AF_INET; - desc = GNUNET_NETWORK_socket_socket (AF_INET, SOCK_STREAM, 0); + desc = GNUNET_NETWORK_socket_create (AF_INET, SOCK_STREAM, 0); GNUNET_assert (desc != NULL); if (GNUNET_NETWORK_socket_setsockopt (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK) GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, diff --git a/src/util/test_connection_addressing.c b/src/util/test_connection_addressing.c index ce44e6acf..f37352c67 100644 --- a/src/util/test_connection_addressing.c +++ b/src/util/test_connection_addressing.c @@ -61,7 +61,7 @@ open_listen_socket () sa.sin_len = sizeof (sa); #endif sa.sin_port = htons (PORT); - desc = GNUNET_NETWORK_socket_socket (AF_INET, SOCK_STREAM, 0); + desc = GNUNET_NETWORK_socket_create (AF_INET, SOCK_STREAM, 0); GNUNET_assert (desc != 0); if (GNUNET_NETWORK_socket_setsockopt (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK) GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, diff --git a/src/util/test_connection_receive_cancel.c b/src/util/test_connection_receive_cancel.c index 6434228f7..e985bf935 100644 --- a/src/util/test_connection_receive_cancel.c +++ b/src/util/test_connection_receive_cancel.c @@ -60,7 +60,7 @@ open_listen_socket () sa.sin_len = sizeof (sa); #endif sa.sin_port = htons (PORT); - desc = GNUNET_NETWORK_socket_socket (AF_INET, SOCK_STREAM, 0); + desc = GNUNET_NETWORK_socket_create (AF_INET, SOCK_STREAM, 0); GNUNET_assert (desc != NULL); if (GNUNET_NETWORK_socket_setsockopt (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK) GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, diff --git a/src/util/test_connection_timeout.c b/src/util/test_connection_timeout.c index 73433e434..5968f797f 100644 --- a/src/util/test_connection_timeout.c +++ b/src/util/test_connection_timeout.c @@ -57,7 +57,7 @@ open_listen_socket () sa.sin_len = sizeof (sa); #endif sa.sin_port = htons (PORT); - desc = GNUNET_NETWORK_socket_socket (AF_INET, SOCK_STREAM, 0); + desc = GNUNET_NETWORK_socket_create (AF_INET, SOCK_STREAM, 0); GNUNET_assert (desc != NULL); if (GNUNET_NETWORK_socket_setsockopt (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK) GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, diff --git a/src/util/test_service.c b/src/util/test_service.c index e9070a912..f615b0cf9 100644 --- a/src/util/test_service.c +++ b/src/util/test_service.c @@ -311,7 +311,7 @@ main (int argc, char *argv[]) NULL); ret += check (); ret += check (); - s = GNUNET_NETWORK_socket_socket (PF_INET6, SOCK_STREAM, 0); + s = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0); if (NULL == s) { if ((errno == ENOBUFS) ||