From db8c2850812b210efde447b29bcd93a695ed4ed8 Mon Sep 17 00:00:00 2001 From: Sylvain Cadilhac Date: Wed, 26 Jul 2023 16:16:47 +0200 Subject: vapi: fix verification for reply message Type: fix Byte swapping should be done before verifying message otherwise the message length will be wrongly computed. Change-Id: I90b2f60bd33e5362e0edd5ee425f6a6f07886f1e Signed-off-by: Sylvain Cadilhac --- src/vpp-api/vapi/vapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c index 45241e1a4b2..46ccf37a8aa 100644 --- a/src/vpp-api/vapi/vapi.c +++ b/src/vpp-api/vapi/vapi.c @@ -1261,13 +1261,13 @@ vapi_dispatch_one (vapi_ctx_t ctx) return VAPI_EINVAL; } const vapi_msg_id_t id = ctx->vl_msg_id_to_vapi_msg_t[vpp_id]; + vapi_get_swap_to_host_func (id) (msg); if (vapi_verify_msg_size (id, msg, size)) { vapi_msg_free (ctx, msg); return VAPI_EINVAL; } u32 context; - vapi_get_swap_to_host_func (id) (msg); if (vapi_msg_is_with_context (id)) { context = *(u32 *) (((u8 *) msg) + vapi_get_context_offset (id)); -- cgit 1.2.3-korg