MGMT_OP_ADD_EXT_ADV_DATA expects the command to be of struct mgmt_cp_add_ext_adv_data not mgmt_cp_add_advertising.
Signed-off-by: Xiuzhuo Shang <[email protected]> --- meta/recipes-connectivity/bluez5/bluez5.inc | 1 + ...sending-extra-bytes-with-MGMT_OP_ADD.patch | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 meta/recipes-connectivity/bluez5/bluez5/0001-advertising-Fix-sending-extra-bytes-with-MGMT_OP_ADD.patch diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc index e827d0a6d7..dfd368ef3f 100644 --- a/meta/recipes-connectivity/bluez5/bluez5.inc +++ b/meta/recipes-connectivity/bluez5/bluez5.inc @@ -72,6 +72,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ file://0001-tools-Work-around-broken-stdin-handling-in-home-made.patch \ file://0001-gatt-client-Fix-use-after-free-caused-by-reentrant-c.patch \ file://0001-transport-Fix-set-volume-failure-with-invalid-device.patch \ + file://0001-advertising-Fix-sending-extra-bytes-with-MGMT_OP_ADD.patch \ " S = "${UNPACKDIR}/bluez-${PV}" diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-advertising-Fix-sending-extra-bytes-with-MGMT_OP_ADD.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-advertising-Fix-sending-extra-bytes-with-MGMT_OP_ADD.patch new file mode 100644 index 0000000000..0a73741367 --- /dev/null +++ b/meta/recipes-connectivity/bluez5/bluez5/0001-advertising-Fix-sending-extra-bytes-with-MGMT_OP_ADD.patch @@ -0,0 +1,33 @@ +From b16441fbb7a24325f7c7d0c5ecedc88b46ddd439 Mon Sep 17 00:00:00 2001 +From: Xiuzhuo Shang <[email protected]> +Date: Thu, 4 Jun 2026 17:32:27 +0800 +Subject: [PATCH] advertising: Fix sending extra bytes with + MGMT_OP_ADD_EXT_ADV_DATA + +MGMT_OP_ADD_EXT_ADV_DATA expects the command to be of size of +struct mgmt_cp_add_ext_adv_data not mgmt_cp_add_advertising. + +Upstream-Status: Backport [2a6968b40378dca5650e18e03ad0407738c47be5] +Signed-off-by: Luiz Augusto von Dentz <[email protected]> +Signed-off-by: Xiuzhuo Shang <[email protected]> +--- + src/advertising.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/advertising.c b/src/advertising.c +index 8970e65f7..0cb37d4ae 100644 +--- a/src/advertising.c ++++ b/src/advertising.c +@@ -1487,8 +1487,7 @@ static void add_adv_params_callback(uint8_t status, uint16_t length, + } + } + +- param_len = sizeof(struct mgmt_cp_add_advertising) + adv_data_len + +- scan_rsp_len; ++ param_len = sizeof(*cp) + adv_data_len + scan_rsp_len; + + cp = malloc0(param_len); + if (!cp) { +-- +2.43.0 + -- 2.43.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#238148): https://lists.openembedded.org/g/openembedded-core/message/238148 Mute This Topic: https://lists.openembedded.org/mt/119658764/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
