Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1] l2test: Fix calling getsockopt(BT_PHY)
Date: Tue,  7 Jul 2026 10:52:55 -0400	[thread overview]
Message-ID: <20260707145255.873524-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

getsockopt(BT_PHY) expectes a 32 bits argument not a
sizeof(struct sockaddr_l2).
---
 tools/l2test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/l2test.c b/tools/l2test.c
index aa05f5247c5e..f44a9406ee2f 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -414,6 +414,8 @@ static int print_info(int sk, struct l2cap_options *opts)
 		conn.dev_class[0], prio, rcvbuf);
 
 
+	optlen = sizeof(phy);
+
 	if (!getsockopt(sk, SOL_BLUETOOTH, BT_PHY, &phy, &optlen)) {
 		syslog(LOG_INFO, "Supported PHY: 0x%08x", phy);
 		print_bitfield(2, phy, phy_table);
-- 
2.54.0


             reply	other threads:[~2026-07-07 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 14:52 Luiz Augusto von Dentz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-07 14:55 [PATCH BlueZ v1] l2test: Fix calling getsockopt(BT_PHY) Luiz Augusto von Dentz

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=20260707145255.873524-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox