summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2023-02-15 13:31:27 +0000
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 16:47:29 +0000
commit60a107c8fd8874694ec72fb526d4d393bf36d1ee (patch)
tree90eaba782478a18b2918be041aab52023a725c23 /src
parent99d3a405431dadca2cb5138183603946b6d64408 (diff)
vppinfra: adding support for socket mounting paths
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: If894b2b741d0d417a6fc458dda83ca1d8192385d
Diffstat (limited to 'src')
-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);