summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vppinfra/socket.c b/src/vppinfra/socket.c
index 2921e008018..a09a390dab3 100644
--- a/src/vppinfra/socket.c
+++ b/src/vppinfra/socket.c
@@ -563,6 +563,9 @@ clib_socket_init_netns (clib_socket_t *s, u8 *namespace)
int old_netns_fd, nfd = -1;
old_netns_fd = clib_netns_open (NULL /* self */);
+ if (old_netns_fd < 0)
+ return clib_error_return_unix (0, "get current netns failed");
+
if ((nfd = clib_netns_open (namespace)) == -1)
{
error = clib_error_return_unix (0, "clib_netns_open '%s'", namespace);