public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH Bluez v2 0/9] mesh: cleanups and a bugfix for relay packets
@ 2025-07-11 21:57 Christian Eggers
  2025-07-11 21:57 ` [PATCH BlueZ v2 1/9] mesh: net-keys: more uses of BEACON_LEN_SNB and BEACON_LEN_MPB Christian Eggers
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Christian Eggers @ 2025-07-11 21:57 UTC (permalink / raw)
  To: Brian Gix, Inga Stotland, linux-bluetooth; +Cc: ceggers

The first 3 patches replace further magic numbers by preprocessor 
defines (no functional changes). Patch 4 tries to improve readabilty,
while 5 and 6 are only cleanups (these patches have already been
submitted in my previous series, but were not merged without any
notice).

Patch 7 and 8 are further simplifications/cleanups, while the last patch
fixes a serious bug which causes corruption in all relayed packets. Maybe
this NEVER worked correctly, although this is a major feature of 
Bluetooth Mesh. At leat this one should get reviewied by a Mesh expert.

v2:
- Fix declaration after statement error in patch 9


^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH BlueZ 1/9] mesh: net-keys: more uses of BEACON_LEN_SNB and BEACON_LEN_MPB
@ 2025-07-11 17:39 Christian Eggers
  2025-07-11 18:50 ` mesh: cleanups and a bugfix for relay packets bluez.test.bot
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Eggers @ 2025-07-11 17:39 UTC (permalink / raw)
  To: Brian Gix, Inga Stotland, linux-bluetooth; +Cc: Christian Eggers

---
 mesh/net-keys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/net-keys.c b/mesh/net-keys.c
index a10f93ccb03e..22ab5b626a84 100644
--- a/mesh/net-keys.c
+++ b/mesh/net-keys.c
@@ -442,10 +442,10 @@ static bool match_beacon(const void *a, const void *b)
 	const uint8_t *incoming = b;
 
 	if (incoming[0] == BEACON_TYPE_MPB)
-		return !memcmp(cached->data, incoming, 27);
+		return !memcmp(cached->data, incoming, BEACON_LEN_MPB - 1);
 
 	if (incoming[0] == BEACON_TYPE_SNB)
-		return !memcmp(cached->data, incoming, 22);
+		return !memcmp(cached->data, incoming, BEACON_LEN_SNB - 1);
 
 	return false;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-07-15 14:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 21:57 [PATCH Bluez v2 0/9] mesh: cleanups and a bugfix for relay packets Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 1/9] mesh: net-keys: more uses of BEACON_LEN_SNB and BEACON_LEN_MPB Christian Eggers
2025-07-11 23:26   ` mesh: cleanups and a bugfix for relay packets bluez.test.bot
2025-07-11 21:57 ` [PATCH BlueZ v2 2/9] mesh: introduce MESH_AD_MAX_LEN and MESH_NET_MAX_PDU_LEN Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 3/9] mesh: replace MESH internal defines by shared ones Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 4/9] mesh: net: constify tx path Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 5/9] mesh: net: remove unused stuff Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 6/9] mesh: net: update comment Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 7/9] mesh: crypto: mesh_crypto_aes_ccm_encrypt(): remove unused parameter Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 8/9] mesh: crypto: simplify mesh_crypto_packet_parse() Christian Eggers
2025-07-11 21:57 ` [PATCH BlueZ v2 9/9] mesh: fix corrupted relay packets Christian Eggers
2025-07-15 14:30 ` [PATCH Bluez v2 0/9] mesh: cleanups and a bugfix for " patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2025-07-11 17:39 [PATCH BlueZ 1/9] mesh: net-keys: more uses of BEACON_LEN_SNB and BEACON_LEN_MPB Christian Eggers
2025-07-11 18:50 ` mesh: cleanups and a bugfix for relay packets bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox