summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vppinfra/socket.c b/src/vppinfra/socket.c
index e61c369f050..40374d736c5 100644
--- a/src/vppinfra/socket.c
+++ b/src/vppinfra/socket.c
@@ -450,7 +450,11 @@ clib_socket_init (clib_socket_t *s)
{
p += 11;
u8 *str = _clib_socket_get_string (&p, 0);
- u8 *pathname = format (0, "/var/run/netns/%v%c", str, 0);
+ u8 *pathname = 0;
+ if (str[0] == '/')
+ pathname = format (0, "%v%c", str, 0);
+ else
+ pathname = format (0, "/var/run/netns/%v%c", str, 0);
if ((netns_fd = open ((char *) pathname, O_RDONLY)) < 0)
err = clib_error_return_unix (0, "open('%s')", pathname);
vec_free (str);