summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/memclnt_api.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2023-04-19 20:02:25 +0000
committerDave Barach <vpp@barachs.net>2023-04-20 21:11:41 +0000
commit5b32d3a13bc66b884bbf25f1409174ed34a8adc7 (patch)
tree90dbc2c2bf0284d723c12898d9a482624443b126 /src/vlibmemory/memclnt_api.c
parentbc4dc16a5ce891649211200f0e346c76cdef4c56 (diff)
api: fix trace_plugin_msg_ids segv in trace dump
With 'api-trace { on }' in startup.conf, running 'api trace dump' in vppctl was causing VPP to seg fault. vl_msg_print_trace() was calling m->endian_handler() without checking whether its null. Checking if its non-null prevents a crash, but the trace dump prints the message IDs for trace_plugin_msg_ids in network byte order. There is an auto-generated endian function for that message. Set it on the call to vl_msg_api_config() for trace_plugin_msg_ids so the IDs will be printed in host byte order in trace dump output. Type: fix Fixes: fe45f8f5 Signed-off-by: Matthew Smith <mgsmith@netgate.com> Change-Id: I0ab463985e9a983155feba13ac4eb99ab883ace6
Diffstat (limited to 'src/vlibmemory/memclnt_api.c')
-rw-r--r--src/vlibmemory/memclnt_api.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vlibmemory/memclnt_api.c b/src/vlibmemory/memclnt_api.c
index 29858dd8497..728edf7804a 100644
--- a/src/vlibmemory/memclnt_api.c
+++ b/src/vlibmemory/memclnt_api.c
@@ -726,6 +726,7 @@ rpc_api_hookup (vlib_main_t *vm)
.id = VL_API_##N, \
.name = #n, \
.handler = vl_api_##n##_t_handler, \
+ .endian = vl_api_##n##_t_endian, \
.format_fn = vl_api_##n##_t_format, \
.size = sizeof (vl_api_##n##_t), \
.traced = 1, \