From: Brian Gix <brian.gix@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: brian.gix@intel.com, inga.stotland@intel.com
Subject: [PATCH BlueZ v5 11/14] mesh: Switch beaconing net key
Date: Mon, 30 Jan 2023 15:52:07 -0800 [thread overview]
Message-ID: <20230130235210.94385-12-brian.gix@gmail.com> (raw)
In-Reply-To: <20230130235210.94385-1-brian.gix@gmail.com>
From: Brian Gix <brian.gix@intel.com>
When transitioning from Phase 1 to Phase 2 of a network key and we are
beaconing, we need to halt the beaconing on the old key version, and
begin beaconing on the new key version.
---
mesh/net.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/mesh/net.c b/mesh/net.c
index 81f1e57ee..05ca48326 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2625,6 +2625,13 @@ static int key_refresh_phase_two(struct mesh_net *net, uint16_t idx)
if (subnet->kr_phase == KEY_REFRESH_PHASE_TWO)
return MESH_STATUS_SUCCESS;
+ /* Stop beaconing on old key */
+ if (net->snb_enable)
+ net_key_beacon_disable(subnet->net_key_tx, false);
+
+ if (net->mpb_enable)
+ net_key_beacon_disable(subnet->net_key_tx, true);
+
subnet->key_refresh = 1;
subnet->net_key_tx = subnet->net_key_upd;
/*
@@ -2632,6 +2639,15 @@ static int key_refresh_phase_two(struct mesh_net *net, uint16_t idx)
* it hears beacons from all the nodes
*/
subnet->kr_phase = KEY_REFRESH_PHASE_TWO;
+
+ /* Start beaconing on new key */
+ if (net->snb_enable)
+ net_key_beacon_enable(subnet->net_key_tx, false, 0);
+
+ if (net->mpb_enable)
+ net_key_beacon_enable(subnet->net_key_tx, true,
+ net->mpb_period);
+
refresh_beacon(subnet, net);
queue_friend_update(net);
--
2.39.1
next prev parent reply other threads:[~2023-01-30 23:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 23:51 [PATCH BlueZ v5 00/14] Mesh v1.1 additions Brian Gix
2023-01-30 23:51 ` [PATCH BlueZ v5 01/14] doc/mesh: Add Remote Provisioning DBus APIs Brian Gix
2023-01-31 5:39 ` Mesh v1.1 additions bluez.test.bot
2023-01-30 23:51 ` [PATCH BlueZ v5 02/14] mesh: Add Remote Provisioning Brian Gix
2023-01-30 23:51 ` [PATCH BlueZ v5 03/14] tools/mesh: Optimize for multiple RPR servers and NPPI Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 04/14] mesh: Rename parameter list per crypto usage Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 05/14] unit/mesh: Add unit testing of Mesh Private Beaconing Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 06/14] mesh: Add storage of Mesh Private Beacon settings Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 07/14] mesh: Add Mesh Private Beacon server Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 08/14] mesh: Add Tx/Rx support of Mesh Private Beacons Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 09/14] mesh: Add internal Mesh Private Beacon model Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 10/14] tools/mesh: Add support for Mesh Private Beacons Brian Gix
2023-01-30 23:52 ` Brian Gix [this message]
2023-01-30 23:52 ` [PATCH BlueZ v5 12/14] mesh: Fix Checksmatch warning Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 13/14] mesh: Remove unused byte swap for ScanBuild Brian Gix
2023-01-30 23:52 ` [PATCH BlueZ v5 14/14] tools/mesh-cfgtest: Support extended device composition Brian Gix
2023-01-31 17:30 ` [PATCH BlueZ v5 00/14] Mesh v1.1 additions patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130235210.94385-12-brian.gix@gmail.com \
--to=brian.gix@gmail.com \
--cc=brian.gix@intel.com \
--cc=inga.stotland@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).