Skip to contentSkip to conversation

Bluetooth: mesh: Correct segmentation logic

PATCH Applied Steve Brown 3 participants 3 messages Oct 11, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: mesh: Correct segmentation logic

The decision whether to segment or not didn't consider the size of the MIC

mesh/net.c +1 -1
index 2d75c4f7d..96e82fe1c 100644
@@ -2098,7 +2098,7 @@ bool net_access_layer_send(uint8_t ttl, uint16_t src, uint32_t dst,
 	if (!result)
 		return false;
 
-	segN = SEG_MAX(len);
+	segN = SEG_MAX(len + sizeof(uint32_t));
 
 	/* Only one ACK required SAR message per destination at a time */
 	if (segN && IS_UNICAST(dst)) {
#1 lore raw

Hi Luiz, Marcel, Johan:

This is a legitimate and important fix. Please apply ASAP.

Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:linux-bluetooth- [email protected]] On Behalf Of Steve Brown
Sent: Wednesday, October 11, 2017 12:06 PM
To: [email protected]
Subject: [PATCH] Bluetooth: mesh: Correct segmentation logic

The decision whether to segment or not didn't consider the size of the MIC

mesh/net.c +1 -1
index 2d75c4f7d..96e82fe1c 100644
@@ -2098,7 +2098,7 @@ bool net_access_layer_send(uint8_t ttl, uint16_t
 src, uint32_t dst,
 	if (!result)
 		return false;
 
-	segN = SEG_MAX(len);
+	segN = SEG_MAX(len + sizeof(uint32_t));
 
 	/* Only one ACK required SAR message per destination at a time */

if (segN && IS_UNICAST(dst)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Steve Brown

Hi Steve,

Quoted 7 lines · Steve Brown

The decision whether to segment or not didn't consider the size of the MIC

mesh/net.c +0 -0
index 2d75c4f7d..96e82fe1c 100644

mesh/net.c bool net_access_layer_send(uint8_t ttl, uint16_t src, uint32_t dst, · line 2104

Quoted 8 lines
mesh/net.c +1 -1
@@ -2098,7 +2098,7 @@ bool net_access_layer_send(uint8_t ttl, uint16_t src, uint32_t dst,
 	if (!result)
 		return false;
 
-	segN = SEG_MAX(len);
+	segN = SEG_MAX(len + sizeof(uint32_t));
 
 	/* Only one ACK required SAR message per destination at a time */
 	if (segN && IS_UNICAST(dst)) {

Applied, thanks.

Johan