From: Brian Gix <brian.gix@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Brian Gix <brian.gix@intel.com>
Subject: [PATCH BlueZ v2 11/11] mesh: Switch beaconing net key
Date: Fri, 20 Jan 2023 11:47:31 -0800 [thread overview]
Message-ID: <20230120194731.90065-12-brian.gix@gmail.com> (raw)
In-Reply-To: <20230120194731.90065-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.0
prev parent reply other threads:[~2023-01-20 19:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 19:47 [PATCH BlueZ v2 00/11] Mesh v1.1 additions Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 01/11] doc/mesh: Add Remote Provisioning DBus APIs Brian Gix
2023-01-20 22:51 ` Mesh v1.1 additions bluez.test.bot
2023-01-20 19:47 ` [PATCH BlueZ v2 02/11] mesh: Add Remote Provisioning Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 03/11] tools/mesh: Optimize for multiple RPR servers and NPPI Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 04/11] mesh: Rename parameter list per crypto usage Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 05/11] unit/mesh: Add unit testing of Mesh Private Beaconing Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 06/11] mesh: Add storage of Mesh Private Beacon settings Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 07/11] mesh: Add Mesh Private Beacon server Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 08/11] mesh: Add Tx/Rx support of Mesh Private Beacons Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 09/11] mesh: Add internal Mesh Private Beacon model Brian Gix
2023-01-20 19:47 ` [PATCH BlueZ v2 10/11] tools/mesh: Add support for Mesh Private Beacons Brian Gix
2023-01-20 19:47 ` Brian Gix [this message]
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=20230120194731.90065-12-brian.gix@gmail.com \
--to=brian.gix@gmail.com \
--cc=brian.gix@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.