Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
From: "Michael N. Moran" <mike@mnmoran.org>
To: linux-bluetooth@vger.kernel.org
Cc: "Michael N. Moran" <mike@mnmoran.org>
Subject: [PATCH BlueZ] The meshctl sock_write() max_len variable is declared as a uint8_t, which causes the calculation of the GATT MTU to be truncated when the MTU (write_mtu) is greater than 259. This error causes incorrect segmentation.
Date: Sat, 28 Sep 2019 10:14:03 -0400
Message-ID: <1569680043-2874-2-git-send-email-mike@mnmoran.org> (raw)
In-Reply-To: <1569680043-2874-1-git-send-email-mike@mnmoran.org>

From: "Michael N. Moran" <mike@mnmoran.org>

---
 tools/mesh/gatt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mesh/gatt.c b/tools/mesh/gatt.c
index 0a942d4..c9e789c 100644
--- a/tools/mesh/gatt.c
+++ b/tools/mesh/gatt.c
@@ -189,7 +189,7 @@ static bool sock_write(struct io *io, void *user_data)
 	struct write_data *data = user_data;
 	struct iovec iov[2];
 	uint8_t sar;
-	uint8_t max_len;
+	uint16_t max_len;
 
 	if (data == NULL)
 		return true;
-- 
1.8.3.1


      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28 14:14 [PATCH BlueZ] meshctl truncates GATT MTU Michael N. Moran
2019-09-28 14:14 ` Michael N. Moran [this message]

Reply instructions:

You may reply publically 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=1569680043-2874-2-git-send-email-mike@mnmoran.org \
    --to=mike@mnmoran.org \
    --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

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git