diff mbox series

[BlueZ,1/4] mesh: Ignore Secure Network Beacon from subnet

Message ID 20220929110344.26130-2-isak.westin@loytec.com (mailing list archive)
State Accepted
Commit 926d16db8ae4bb5c40266be5bd6b10023d932c0d
Headers show
Series Mesh: Fix IV update and KeyRefresh procedures | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/setupell success Setup ELL PASS
tedd_an/buildprep success Build Prep PASS
tedd_an/build success Build Configuration PASS
tedd_an/makecheck success Make Check PASS
tedd_an/makecheckvalgrind success Make Check PASS
tedd_an/makedistcheck success Make Distcheck PASS
tedd_an/build_extell success Build External ELL PASS
tedd_an/build_extell_make success Build Make with External ELL PASS
tedd_an/incremental_build success Pass
tedd_an/scan_build success Pass

Commit Message

Isak Westin Sept. 29, 2022, 11:03 a.m. UTC
If this node is a member of a primary subnet and receives a Secure Network
beacon on a secondary subnet with an IV Index greater than the last known
IV Index of the primary subnet, the Secure Network beacon shall be ignored.
See MshPRFv1.0.1 section 3.10.5.
---
 mesh/net.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Sept. 29, 2022, 12:18 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=681871

---Test result---

Test Summary:
CheckPatch                    PASS      2.64 seconds
GitLint                       PASS      1.80 seconds
Prep - Setup ELL              PASS      31.47 seconds
Build - Prep                  PASS      0.79 seconds
Build - Configure             PASS      9.77 seconds
Build - Make                  PASS      1043.24 seconds
Make Check                    PASS      12.14 seconds
Make Check w/Valgrind         PASS      339.70 seconds
Make Distcheck                PASS      276.83 seconds
Build w/ext ELL - Configure   PASS      9.53 seconds
Build w/ext ELL - Make        PASS      102.83 seconds
Incremental Build w/ patches  PASS      483.15 seconds
Scan Build                    PASS      617.89 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/mesh/net.c b/mesh/net.c
index 7fec98531..dc3d1fd80 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2708,7 +2708,7 @@  static void process_beacon(void *net_ptr, void *user_data)
 	struct net_beacon_data *beacon_data = user_data;
 	uint32_t ivi;
 	bool ivu, kr, local_kr;
-	struct mesh_subnet *subnet;
+	struct mesh_subnet *subnet, *primary_subnet;
 
 	ivi = beacon_data->ivi;
 
@@ -2723,6 +2723,17 @@  static void process_beacon(void *net_ptr, void *user_data)
 	if (!subnet)
 		return;
 
+	/*
+	 * @MshPRFv1.0.1 section 3.10.5: IV Update procedure
+	 * If this node is a member of a primary subnet and receives a Secure
+	 * Network beacon on a secondary subnet with an IV Index greater than
+	 * the last known IV Index of the primary subnet, the Secure Network
+	 * beacon shall be ignored.
+	 */
+	primary_subnet = get_primary_subnet(net);
+	if (primary_subnet && subnet != primary_subnet && ivi > net->iv_index)
+		return;
+
 	/* Get IVU and KR boolean bits from beacon */
 	ivu = beacon_data->ivu;
 	kr = beacon_data->kr;