diff options
-rw-r--r-- | src/vlibmemory/socket_client.c | 2 | ||||
-rw-r--r-- | src/vppinfra/socket.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c index 530a99677f4..69126f88963 100644 --- a/src/vlibmemory/socket_client.c +++ b/src/vlibmemory/socket_client.c @@ -462,7 +462,7 @@ vl_socket_client_connect_internal (socket_client_main_t * scm, sock = &scm->client_socket; sock->config = socket_path; - sock->flags = CLIB_SOCKET_F_IS_CLIENT | CLIB_SOCKET_F_NON_BLOCKING_CONNECT; + sock->flags = CLIB_SOCKET_F_IS_CLIENT; if ((error = clib_socket_init (sock))) { diff --git a/src/vppinfra/socket.c b/src/vppinfra/socket.c index 3271393529d..1d8b2ca2e45 100644 --- a/src/vppinfra/socket.c +++ b/src/vppinfra/socket.c @@ -518,6 +518,14 @@ clib_socket_init (clib_socket_t * s) s->fd, s->config); goto done; } + /* Connect was blocking so set fd to non-blocking now */ + if (!(s->flags & CLIB_SOCKET_F_NON_BLOCKING_CONNECT) && + fcntl (s->fd, F_SETFL, O_NONBLOCK) < 0) + { + error = clib_error_return_unix (0, "fcntl NONBLOCK2 (fd %d, '%s')", + s->fd, s->config); + goto done; + } } return error; |