From: Brian Gix <brian.gix@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Brian Gix <brian.gix@intel.com>
Subject: [PATCH BlueZ 12/12] mesh: Switch beaconing net key
Date: Thu, 19 Jan 2023 15:57:55 -0800 [thread overview]
Message-ID: <20230119235755.46002-13-brian.gix@gmail.com> (raw)
In-Reply-To: <20230119235755.46002-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 049f0c44c..de4552343 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-19 23:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 23:57 [PATCH BlueZ 00/12] Mesh v1.1 additions Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 01/12] doc/mesh: Add Remote Provisioning DBus APIs Brian Gix
2023-01-20 4:12 ` Mesh v1.1 additions bluez.test.bot
2023-01-19 23:57 ` [PATCH BlueZ 02/12] mesh: Add Remote Provisioning Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 03/12] tools/mesh: Optimize for multiple RPR servers and NPPI Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 04/12] mesh: Rename parameter list per crypto usage Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 05/12] unit/mesh: Add unit testing of Mesh Private Beaconing Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 06/12] mesh: Add storage of Mesh Private Beacon settings Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 07/12] mesh: Add Mesh Private Beacon server Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 08/12] mesh: Add Tx/Rx support of Mesh Private Beacons Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 09/12] mesh: Add internal Mesh Private Beacon model Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 10/12] mesh: Plumb in " Brian Gix
2023-01-19 23:57 ` [PATCH BlueZ 11/12] tools/mesh: Add support for Mesh Private Beacons Brian Gix
2023-01-19 23:57 ` 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=20230119235755.46002-13-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.