bluez: 5.71 -> 5.72

This commit is contained in:
Tim Biermann 2024-01-13 14:46:16 +01:00
parent acb1f9e88f
commit bd7f7b1629
Signed by: tb
GPG Key ID: 42F8B4E30B673606
6 changed files with 11 additions and 234 deletions

View File

@ -37,9 +37,9 @@ drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/bluetooth/
-rwxr-xr-x root/root usr/lib/bluetooth/bluetoothd
-rwxr-xr-x root/root usr/lib/libbluetooth.la
lrwxrwxrwx root/root usr/lib/libbluetooth.so -> libbluetooth.so.3.19.11
lrwxrwxrwx root/root usr/lib/libbluetooth.so.3 -> libbluetooth.so.3.19.11
-rwxr-xr-x root/root usr/lib/libbluetooth.so.3.19.11
lrwxrwxrwx root/root usr/lib/libbluetooth.so -> libbluetooth.so.3.19.12
lrwxrwxrwx root/root usr/lib/libbluetooth.so.3 -> libbluetooth.so.3.19.12
-rwxr-xr-x root/root usr/lib/libbluetooth.so.3.19.12
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/bluez.pc
drwxr-xr-x root/root usr/share/

View File

@ -1,8 +1,6 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF34qvcze+j0fs/mVGpypN1VMI0CiuSzkSeMx5xHZX6mMB3Xf1pAyWuJ3OrkKjxFw+AJeipP2tskqGs1epxZAU7As=
SHA256 (Pkgfile) = 708c85da7eb8dc51b089ae770e7169a8e7b1165a6b297f8d28bb476d983800e4
SHA256 (.footprint) = a2b63e3b3a200e23cd7b29abca0ee094dfca6cd624320b2ab2a62001bc4f2356
SHA256 (bluez-5.71.tar.xz) = b828d418c93ced1f55b616fb5482cf01537440bfb34fbda1a564f3ece94735d8
SHA256 (fix-bluez-5.71-autoconnection.diff) = d851ba385d3e37f89bebb8e411e240e0f7786dd47e67f6ea8ca6b75092ed0ccc
SHA256 (fix-bluez-5.71-coredump-on-a2dp-suspend.diff) = f03b0c6cbc090937064ad0777435c660b190a70ffc23bf3932944729bbd51df2
SHA256 (bluetoothd.service) = f876740278b69bc650ef0a47ff28bf1221c669a1241c9b4c6691d2f3e9cf3ce4
RWSagIOpLGJF31gSO9xP/Zofy3lNFHS/Yh/I28YEZFyHj0Rt9b0McdtGguJG33CLrRmn1M3kuZ2bqt+tBO+OVol7xtZCMhvJ5AU=
SHA256 (Pkgfile) = c937518b55f80eac4811dde486c3c006f21a8b0c0fc37272c5aa4ef2bc88ed93
SHA256 (.footprint) = 79d2df97507a2bb0d5c4c2a7d36eac2d60214acaf1099fdcc11180d9e2550f0a
SHA256 (bluez-5.72.tar.xz) = 499d7fa345a996c1bb650f5c6749e1d929111fa6ece0be0e98687fee6124536e
SHA256 (bluetoothd.service) = ab562292d8e226cc1ec809002c39fa99a7813a4157fabbbbe4fd77fc095ab83b

View File

@ -5,19 +5,14 @@
# Optional: alsa-lib cups docutils json-c libical
name=bluez
version=5.71
release=2
version=5.72
release=1
source=(https://mirrors.edge.kernel.org/pub/linux/bluetooth/bluez-$version.tar.xz
fix-bluez-5.71-autoconnection.diff
fix-bluez-5.71-coredump-on-a2dp-suspend.diff
bluetoothd.service)
build() {
cd bluez-$version
patch -Np1 -i $SRC/fix-bluez-5.71-autoconnection.diff
patch -Np1 -i $SRC/fix-bluez-5.71-coredump-on-a2dp-suspend.diff
prt-get isinst alsa-lib && PKGMK_BLUEZ+=' --enable-midi'
prt-get isinst cups && PKGMK_BLUEZ+=' --enable-cups' || PKGMK_BLUEZ+=' --disable-cups'
prt-get isinst docutils || PKGMK_BLUEZ+=' --disable-manpages'

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# /etc/rc.d/bluetoothd: start/stop greetd
# /etc/rc.d/bluetoothd: start/stop bluetoothd
#
SSD=/sbin/start-stop-daemon

View File

@ -1,163 +0,0 @@
From 7ad5669402c9acff8e4cc808edc12a41df36654e Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Wed, 20 Dec 2023 12:20:03 -0500
Subject: [PATCH] adapter: Fix link key address type for old kernels
On old kernels only BDADDR_BREDR is supported so this attempts to detect
that and retry.
Fixes: https://github.com/bluez/bluez/issues/686
---
src/adapter.c | 59 ++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 15 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index ee70b00d2..022390f0d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -311,6 +311,7 @@ struct btd_adapter {
bool pincode_requested; /* PIN requested during last bonding */
GSList *connections; /* Connected devices */
GSList *devices; /* Devices structure pointers */
+ GSList *load_keys; /* Devices keys to be loaded */
GSList *connect_list; /* Devices to connect when found */
struct btd_device *connect_le; /* LE device waiting to be connected */
sdp_list_t *services; /* Services associated to adapter */
@@ -4284,6 +4285,9 @@ static int set_privacy(struct btd_adapter *adapter, uint8_t privacy)
return -1;
}
+static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
+ bool retry);
+
static void load_link_keys_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
@@ -4293,18 +4297,31 @@ static void load_link_keys_complete(uint8_t status, uint16_t length,
btd_error(adapter->dev_id,
"Failed to load link keys for hci%u: %s (0x%02x)",
adapter->dev_id, mgmt_errstr(status), status);
+
+ if (status == MGMT_STATUS_INVALID_PARAMS) {
+ load_link_keys(adapter, btd_opts.debug_keys, true);
+ /* Release keys after retry since we shall only retry
+ * once.
+ */
+ goto done;
+ }
+
return;
}
DBG("link keys loaded for hci%u", adapter->dev_id);
+
+done:
+ g_slist_free_full(adapter->load_keys, g_free);
+ adapter->load_keys = NULL;
}
-static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
- bool debug_keys)
+static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
+ bool retry)
{
struct mgmt_cp_load_link_keys *cp;
struct mgmt_link_key_info *key;
- size_t key_count, cp_size;
+ size_t count, cp_size;
unsigned int id;
GSList *l;
@@ -4318,12 +4335,14 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
if (!(adapter->supported_settings & MGMT_SETTING_BREDR))
return;
- key_count = g_slist_length(keys);
+ count = g_slist_length(adapter->load_keys);
+ if (!count)
+ return;
- DBG("hci%u keys %zu debug_keys %d", adapter->dev_id, key_count,
- debug_keys);
+ DBG("hci%u keys %zu debug_keys %d retry %s", adapter->dev_id, count,
+ debug_keys, retry ? "true" : "false");
- cp_size = sizeof(*cp) + (key_count * sizeof(*key));
+ cp_size = sizeof(*cp) + (count * sizeof(*key));
cp = g_try_malloc0(cp_size);
if (cp == NULL) {
@@ -4341,13 +4360,18 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
* behavior for debug keys.
*/
cp->debug_keys = debug_keys;
- cp->key_count = htobs(key_count);
+ cp->key_count = htobs(count);
- for (l = keys, key = cp->keys; l != NULL; l = g_slist_next(l), key++) {
+ for (l = adapter->load_keys, key = cp->keys; l != NULL;
+ l = g_slist_next(l), key++) {
struct link_key_info *info = l->data;
bacpy(&key->addr.bdaddr, &info->bdaddr);
- key->addr.type = info->bdaddr_type;
+ /* Old kernels might only support loading with type set to
+ * BDADDR_BREDR so on retry set that instead of using the stored
+ * info.
+ */
+ key->addr.type = retry ? BDADDR_BREDR : info->bdaddr_type;
key->type = info->type;
memcpy(key->val, info->key, 16);
key->pin_len = info->pin_len;
@@ -4359,9 +4383,12 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
g_free(cp);
- if (id == 0)
+ if (id == 0) {
btd_error(adapter->dev_id, "Failed to load link keys for hci%u",
adapter->dev_id);
+ g_slist_free_full(adapter->load_keys, g_free);
+ adapter->load_keys = NULL;
+ }
}
static void load_ltks_complete(uint8_t status, uint16_t length,
@@ -4873,7 +4900,6 @@ static void load_defaults(struct btd_adapter *adapter)
static void load_devices(struct btd_adapter *adapter)
{
char dirname[PATH_MAX];
- GSList *keys = NULL;
GSList *ltks = NULL;
GSList *irks = NULL;
GSList *params = NULL;
@@ -4964,7 +4990,8 @@ static void load_devices(struct btd_adapter *adapter)
}
if (key_info)
- keys = g_slist_append(keys, key_info);
+ adapter->load_keys = g_slist_append(adapter->load_keys,
+ key_info);
if (ltk_info)
ltks = g_slist_append(ltks, ltk_info);
@@ -5013,8 +5040,7 @@ static void load_devices(struct btd_adapter *adapter)
closedir(dir);
- load_link_keys(adapter, keys, btd_opts.debug_keys);
- g_slist_free_full(keys, g_free);
+ load_link_keys(adapter, btd_opts.debug_keys, false);
load_ltks(adapter, ltks);
g_slist_free_full(ltks, g_free);
@@ -6930,6 +6956,9 @@ static void adapter_remove(struct btd_adapter *adapter)
g_slist_free(adapter->devices);
adapter->devices = NULL;
+ g_slist_free(adapter->load_keys);
+ adapter->load_keys = NULL;
+
discovery_cleanup(adapter, 0);
unload_drivers(adapter);

View File

@ -1,53 +0,0 @@
From: Vlad Pruteanu <vlad.pruteanu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com,
silviu.barbulescu@nxp.com, iulia.tanasescu@nxp.com,
andrei.istodorescu@nxp.com, luiz.dentz@gmail.com,
Vlad Pruteanu <vlad.pruteanu@nxp.com>
Subject: [PATCH 1/1] transport: Check if transport is bcast before it's cast to bap_transport
Date: Tue, 19 Dec 2023 14:49:16 +0200 [thread overview]
Message-ID: <20231219124916.44173-2-vlad.pruteanu@nxp.com> (raw)
In-Reply-To: <20231219124916.44173-1-vlad.pruteanu@nxp.com>
Currently, when a transport is released it is cast to bap_transport without
checking if the transport is actually a broadcast one. Then, based on this
cast it is released. Problems may occur with transports that are not
broadcast, but are still cast to bap_transport. This commit fixes this
problem.
---
profiles/audio/transport.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index e2073451c..555da99a8 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -643,7 +643,6 @@ static DBusMessage *release(DBusConnection *conn, DBusMessage *msg,
{
struct media_transport *transport = data;
struct media_owner *owner = transport->owner;
- struct bap_transport *bap = transport->data;
const char *sender;
struct media_request *req;
guint id;
@@ -675,9 +674,17 @@ static DBusMessage *release(DBusConnection *conn, DBusMessage *msg,
req = media_request_create(msg, id);
media_owner_add(owner, req);
- if (bt_bap_stream_get_type(bap->stream) ==
- BT_BAP_STREAM_TYPE_BCAST) {
- bap_disable_complete(bap->stream, 0x00, 0x00, owner);
+ if (!strcmp(media_endpoint_get_uuid(transport->endpoint),
+ BAA_SERVICE_UUID)
+ || !strcmp(media_endpoint_get_uuid(transport->endpoint),
+ BCAA_SERVICE_UUID)) {
+
+ struct bap_transport *bap = transport->data;
+
+ if (bt_bap_stream_get_type(bap->stream) ==
+ BT_BAP_STREAM_TYPE_BCAST) {
+ bap_disable_complete(bap->stream, 0x00, 0x00, owner);
+ }
}
return NULL;