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:55:02 -0400 [thread overview]
Message-ID: <20260707145502.874602-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 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/l2test.c b/tools/l2test.c
index aa05f5247c5e..08d2269936b9 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -358,7 +358,8 @@ static int print_info(int sk, struct l2cap_options *opts)
struct sockaddr_l2 addr;
socklen_t optlen;
struct l2cap_conninfo conn;
- int prio, phy;
+ int prio;
+ uint32_t phy;
char ba[18];
/* Get connection information */
@@ -414,6 +415,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
next reply other threads:[~2026-07-07 14:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 14:55 Luiz Augusto von Dentz [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-07-07 14:52 [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=20260707145502.874602-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