aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vpp/stats/stat_segment.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vpp/stats/stat_segment.c b/src/vpp/stats/stat_segment.c
index c89185c6d82..7ae1316736d 100644
--- a/src/vpp/stats/stat_segment.c
+++ b/src/vpp/stats/stat_segment.c
@@ -553,9 +553,11 @@ stats_segment_socket_init (void)
clib_error_t *error;
clib_socket_t *s = clib_mem_alloc (sizeof (clib_socket_t));
+ memset (s, 0, sizeof (clib_socket_t));
s->config = (char *) sm->socket_name;
s->flags = CLIB_SOCKET_F_IS_SERVER | CLIB_SOCKET_F_SEQPACKET |
CLIB_SOCKET_F_ALLOW_GROUP_WRITE | CLIB_SOCKET_F_PASSCRED;
+
if ((error = clib_socket_init (s)))
{
clib_error_report (error);
@@ -565,8 +567,7 @@ stats_segment_socket_init (void)
clib_file_t template = { 0 };
template.read_function = stats_socket_accept_ready;
template.file_descriptor = s->fd;
- template.description =
- format (0, "stats segment listener %s", STAT_SEGMENT_SOCKET_FILE);
+ template.description = format (0, "stats segment listener %s", s->config);
clib_file_add (&file_main, &template);
sm->socket = s;
@@ -595,6 +596,7 @@ statseg_init (vlib_main_t * vm)
stat_segment_main_t *sm = &stat_segment_main;
clib_error_t *error;
+ /* dependent on unix_input_init */
if ((error = vlib_call_init_function (vm, unix_input_init)))
return error;
@@ -627,7 +629,6 @@ statseg_config (vlib_main_t * vm, unformat_input_t * input)
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);
}
-
return 0;
}
@@ -637,8 +638,10 @@ VLIB_EARLY_CONFIG_FUNCTION (statseg_config, "statseg");
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (stat_segment_collector, static) =
{
-.function = stat_segment_collector_process,.name =
- "statseg-collector-process",.type = VLIB_NODE_TYPE_PROCESS,};
+.function = stat_segment_collector_process,
+.name = "statseg-collector-process",
+.type = VLIB_NODE_TYPE_PROCESS,
+};
/* *INDENT-ON* */