summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSylvain Cadilhac <sylvain.cadilhac@freepro.com>2023-07-26 16:16:47 +0200
committerOle Tr�an <otroan@employees.org>2023-09-06 08:23:55 +0000
commitdb8c2850812b210efde447b29bcd93a695ed4ed8 (patch)
tree17acf4062d36035f7a6f7746ed0a786aecd648f3 /src
parent109f3ce4eba0a6ba869752f24cfaae73ab70bb2d (diff)
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 <sylvain.cadilhac@freepro.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/vapi/vapi.c2
1 files changed, 1 insertions, 1 deletions
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));