From: xiuzhuo.shang@oss.qualcomm.com Date: Fri, 5 Jun 2026 06:45:13 +0000 (+0800) Subject: bluez5: Fix sending extra bytes with MGMT_OP_ADD_EXT_ADV_DATA X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f143e23e2e378129d6eaaab912b701cc12cc044a;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git bluez5: Fix sending extra bytes with MGMT_OP_ADD_EXT_ADV_DATA 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- 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 +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 +Signed-off-by: Xiuzhuo Shang +--- + 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 +