From 269f04cd264bda0353514ab2b39de33dcbf2a77a Mon Sep 17 00:00:00 2001 From: Christian Eggers Date: Mon, 5 May 2025 14:43:43 +0200 Subject: [PATCH] mesh: acceptor: fix endianess issues Members of 'struct mesh_net_prov_caps' are in Over-the-Air order and must be converted to host order first. Fixes: 838ddc931263 ("mesh: provisionee: Check prov start parameters") --- mesh/prov-acceptor.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c index 241345bdd..27d496431 100644 --- a/mesh/prov-acceptor.c +++ b/mesh/prov-acceptor.c @@ -408,15 +408,17 @@ static bool prov_start_check(struct prov_start *start, break; case 2: /* Output OOB */ - if (!(caps->output_action & (1 << start->auth_action)) || - start->auth_size == 0) + if (!(L_BE16_TO_CPU(caps->output_action) & + (1 << start->auth_action)) || + start->auth_size == 0) return false; break; case 3: /* Input OOB */ - if (!(caps->input_action & (1 << start->auth_action)) || - start->auth_size == 0) + if (!(L_BE16_TO_CPU(caps->input_action) & + (1 << start->auth_action)) || + start->auth_size == 0) return false; break; -- 2.47.3