diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2018-10-20 14:51:14 -0700 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2018-10-22 09:11:48 +0000 |
commit | 95b1b10e54545132ba55821e32c2f1a48d0e0e16 (patch) | |
tree | 435619694a59770c52726fffd060559805f1e326 /src | |
parent | 8254018c21bbdbbc11225ebc444b1d072606caf7 (diff) |
Fix stat_segment.c issue.
* using default socket name even when overridden in config.
Change-Id: I1849bf5269629873afd1dd48d2df785a491781c3
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vpp/stats/stat_segment.c | 13 |
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* */ |