| 1 | From b84aa894921037e1b1de00d282db2ee27a4ce63f Mon Sep 17 00:00:00 2001
|
| 2 | From: Luiz Augusto von Dentz <[email protected]>
|
| 3 | Date: Mon, 6 Jul 2026 10:59:28 -0400
|
| 4 | Subject: l2test: Fix calling getsockopt(BT_PHY)
|
| 5 |
|
| 6 | getsockopt(BT_PHY) expectes a 32 bits argument not a
|
| 7 | sizeof(struct sockaddr_l2).
|
| 8 | ---
|
| 9 | tools/l2test.c | 5 ++++-
|
| 10 | 1 file changed, 4 insertions(+), 1 deletion(-)
|
| 11 |
|
| 12 | diff --git a/tools/l2test.c b/tools/l2test.c
|
| 13 | index aa05f5247..08d226993 100644
|
| 14 | |
| 15 | |
| 16 | @@ -358,7 +358,8 @@ static int print_info(int sk, struct l2cap_options *opts)
|
| 17 | struct sockaddr_l2 addr;
|
| 18 | socklen_t optlen;
|
| 19 | struct l2cap_conninfo conn;
|
| 20 | - int prio, phy;
|
| 21 | + int prio;
|
| 22 | + uint32_t phy;
|
| 23 | char ba[18];
|
| 24 |
|
| 25 | /* Get connection information */
|
| 26 | @@ -414,6 +415,8 @@ static int print_info(int sk, struct l2cap_options *opts)
|
| 27 | conn.dev_class[0], prio, rcvbuf);
|
| 28 |
|
| 29 |
|
| 30 | + optlen = sizeof(phy);
|
| 31 | +
|
| 32 | if (!getsockopt(sk, SOL_BLUETOOTH, BT_PHY, &phy, &optlen)) {
|
| 33 | syslog(LOG_INFO, "Supported PHY: 0x%08x", phy);
|
| 34 | print_bitfield(2, phy, phy_table);
|
| 35 | --
|
| 36 | cgit 1.3-korg
|
| 37 |
|