diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vlibmemory/socket_api.c | 27 | ||||
-rw-r--r-- | src/vlibmemory/socket_api.h | 5 | ||||
-rw-r--r-- | src/vpp-api/python/vpp_papi/vpp_papi.py | 2 |
3 files changed, 13 insertions, 21 deletions
diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c index d3beafb3345..5aad8a9598f 100644 --- a/src/vlibmemory/socket_api.c +++ b/src/vlibmemory/socket_api.c @@ -723,22 +723,6 @@ vl_sock_api_init (vlib_main_t * vm) vec_resize (sm->input_buffer, 4096); sock->config = (char *) sm->socket_name; - - /* mkdir of file socket, only under /run */ - if (strncmp (sock->config, "/run", 4) == 0) - { - u8 *tmp = format (0, "%s", sock->config); - int i = vec_len (tmp); - while (i && tmp[--i] != '/') - ; - - tmp[i] = 0; - - if (i) - vlib_unix_recursive_mkdir ((char *) tmp); - vec_free (tmp); - } - sock->flags = CLIB_SOCKET_F_IS_SERVER | CLIB_SOCKET_F_ALLOW_GROUP_WRITE; error = clib_socket_init (sock); if (error) @@ -791,16 +775,21 @@ socksvr_config (vlib_main_t * vm, unformat_input_t * input) { if (unformat (input, "socket-name %s", &sm->socket_name)) ; + /* DEPRECATE: default keyword is ignored */ else if (unformat (input, "default")) - { - sm->socket_name = format (0, "%s%c", API_SOCKET_FILE, 0); - } + ; else { return clib_error_return (0, "unknown input '%U'", format_unformat_error, input); } } + + if (!vec_len (sm->socket_name)) + sm->socket_name = format (0, "%s/%s", vlib_unix_get_runtime_dir (), + API_SOCKET_FILENAME); + vec_terminate_c_string (sm->socket_name); + return 0; } diff --git a/src/vlibmemory/socket_api.h b/src/vlibmemory/socket_api.h index f3af300238c..7192e0fcacc 100644 --- a/src/vlibmemory/socket_api.h +++ b/src/vlibmemory/socket_api.h @@ -22,7 +22,10 @@ #include <svm/ssvm.h> #include <vppinfra/file.h> -#define API_SOCKET_FILE "/run/vpp-api.sock" +/* Deprecated */ +#define API_SOCKET_FILE "/run/vpp/api.sock" + +#define API_SOCKET_FILENAME "api.sock" typedef struct { diff --git a/src/vpp-api/python/vpp_papi/vpp_papi.py b/src/vpp-api/python/vpp_papi/vpp_papi.py index a4523b46329..818a55f52f3 100644 --- a/src/vpp-api/python/vpp_papi/vpp_papi.py +++ b/src/vpp-api/python/vpp_papi/vpp_papi.py @@ -191,7 +191,7 @@ class VPPApiClient(object): def __init__(self, apifiles=None, testmode=False, async_thread=True, logger=None, loglevel=None, read_timeout=5, use_socket=False, - server_address='/run/vpp-api.sock'): + server_address='/run/vpp/api.sock'): """Create a VPP API object. apifiles is a list of files containing API |