summaryrefslogtreecommitdiff
path: root/mesh
diff options
context:
space:
mode:
authorIsak Westin <isak.westin@loytec.com>2022-09-29 13:03:42 +0200
committerBrian Gix <brian.gix@intel.com>2022-10-03 14:19:19 -0700
commit7d050890f01f32ebb394140cf3206ad5a5548d79 (patch)
tree3512290eacf1e4efed1d23d68e8927a549aa857e /mesh
parent926d16db8ae4bb5c40266be5bd6b10023d932c0d (diff)
downloadbluez-7d050890f01f32ebb394140cf3206ad5a5548d79.tar.gz
mesh: Ignore SNB with invalid IV Index values
If we are in IV update in progress state, and receive a Secure Network beacon with an IV index equal to last known IV index + 1, and IV update flag set to 1, it should be ignored. See MshPRFv1.0.1 section 3.10.5.
Diffstat (limited to 'mesh')
-rw-r--r--mesh/net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesh/net.c b/mesh/net.c
index dc3d1fd80..c225fdb9a 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2671,6 +2671,10 @@ static bool update_iv_ivu_state(struct mesh_net *net, uint32_t iv_index,
if (iv_index == net->iv_index)
return false;
+ /* Ignore beacon with invalid IV index value */
+ if (net->iv_update && iv_index == net->iv_index + 1)
+ return false;
+
if (!net->iv_update) {
l_debug("iv_upd_state = IV_UPD_UPDATING");
net->iv_upd_state = IV_UPD_UPDATING;