summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/memif.c14
-rw-r--r--src/plugins/memif/private.h1
2 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index ba1231495c8..af81faf2711 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -556,15 +556,19 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args)
if (args->socket_filename == 0 || args->socket_filename[0] != '/')
{
- rv = mkdir (MEMIF_DEFAULT_SOCKET_DIR, 0755);
- if (rv && errno != EEXIST)
- return VNET_API_ERROR_SYSCALL_ERROR_1;
+ clib_error_t *error;
+ error = vlib_unix_recursive_mkdir (vlib_unix_get_runtime_dir ());
+ if (error)
+ {
+ clib_error_free (error);
+ return VNET_API_ERROR_SYSCALL_ERROR_1;
+ }
if (args->socket_filename == 0)
- socket_filename = format (0, "%s/%s%c", MEMIF_DEFAULT_SOCKET_DIR,
+ socket_filename = format (0, "%s/%s%c", vlib_unix_get_runtime_dir (),
MEMIF_DEFAULT_SOCKET_FILENAME, 0);
else
- socket_filename = format (0, "%s/%s%c", MEMIF_DEFAULT_SOCKET_DIR,
+ socket_filename = format (0, "%s/%s%c", vlib_unix_get_runtime_dir (),
args->socket_filename, 0);
}
diff --git a/src/plugins/memif/private.h b/src/plugins/memif/private.h
index 0f82f1e9575..985ac5ec985 100644
--- a/src/plugins/memif/private.h
+++ b/src/plugins/memif/private.h
@@ -17,7 +17,6 @@
#include <vppinfra/lock.h>
-#define MEMIF_DEFAULT_SOCKET_DIR "/run/vpp"
#define MEMIF_DEFAULT_SOCKET_FILENAME "memif.sock"
#define MEMIF_DEFAULT_RING_SIZE 1024
#define MEMIF_DEFAULT_RX_QUEUES 1