All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pauli Virtanen <pav@iki.fi>
To: linux-bluetooth@vger.kernel.org
Cc: Pauli Virtanen <pav@iki.fi>
Subject: [PATCH BlueZ v2] media: set default value for BAP endpoint Vendor field
Date: Wed,  1 Feb 2023 19:51:47 +0000	[thread overview]
Message-ID: <26d36cc8d645773b6795a18355631134bf2bd074.1675281104.git.pav@iki.fi> (raw)
In-Reply-To: <d23190507e9c7131481648848d0afd62448226d3.1675276185.git.pav@iki.fi>

The "Vendor" field is optional, and should have an initialized valid
default value.

It has the default values in register_endpoint, but not in
app_register_endpoint, so make the latter match the former.
---

Notes:
    v2: Let's not use C99 initializers.
    
    The uninitialized values cause Pipewire media endpoint registrations to
    fail, and this makes it work again. Its BAP media endpoints do not have
    the Vendor field, given that they use LC3, so the struct in
    app_register_endpoint ends up containing random garbage.  The resulting
    invalid codec/cid/vid value combination is rejected by
    bt_bap_add_vendor_pac.

 profiles/audio/media.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index d96367454..8a2afd04c 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -2583,6 +2583,8 @@ static void app_register_endpoint(void *data, void *user_data)
 
 	dbus_message_iter_get_basic(&iter, &codec);
 
+	memset(&vendor, 0, sizeof(vendor));
+
 	if (g_dbus_proxy_get_property(proxy, "Vendor", &iter)) {
 		if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
 			goto fail;
-- 
2.39.1


  parent reply	other threads:[~2023-02-01 19:51 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 20:52 [RFC, BlueZ] bap: check adapter support before enabling BAP Pauli Virtanen
2023-01-27 21:12 ` [RFC,BlueZ] " bluez.test.bot
2023-01-28  0:28 ` [RFC, BlueZ] " Luiz Augusto von Dentz
2023-01-28  0:29   ` Luiz Augusto von Dentz
2023-01-28  9:26   ` Pauli Virtanen
2023-01-30 18:37 ` [PATCH BlueZ 1/8] doc: add MGMT setting for CIS features, remove Quality Report Pauli Virtanen
2023-01-30 18:37   ` [PATCH BlueZ 2/8] lib: Add defines for MGMT setting bits for CIS feature support Pauli Virtanen
2023-02-07  1:13     ` Luiz Augusto von Dentz
2023-01-30 18:37   ` [PATCH BlueZ 3/8] monitor: add names " Pauli Virtanen
2023-02-07  1:12     ` Luiz Augusto von Dentz
2023-01-30 18:37   ` [PATCH BlueZ 4/8] tools/btmgmt: " Pauli Virtanen
2023-02-07  1:14     ` Luiz Augusto von Dentz
2023-01-30 18:37   ` [PATCH BlueZ 5/8] adapter: add functions indicating adapter CIS capability Pauli Virtanen
2023-02-07  1:10     ` Luiz Augusto von Dentz
2023-01-30 18:37   ` [PATCH BlueZ 6/8] media: Check adapter CIS support to add BAP in SupportedUUIDs Pauli Virtanen
2023-01-30 18:37   ` [PATCH BlueZ 7/8] shared/bap: handle central-only case Pauli Virtanen
2023-01-30 19:39     ` Luiz Augusto von Dentz
2023-01-30 20:04       ` Pauli Virtanen
2023-02-07  1:19         ` Luiz Augusto von Dentz
2023-01-30 18:37   ` [PATCH BlueZ 8/8] bap: handle adapters that are not CIS Central / Peripheral capable Pauli Virtanen
2023-02-07  1:27     ` Luiz Augusto von Dentz
2023-01-30 20:13   ` [BlueZ,1/8] doc: add MGMT setting for CIS features, remove Quality Report bluez.test.bot
2023-02-07  1:08   ` [PATCH BlueZ 1/8] " Luiz Augusto von Dentz
2023-02-10 20:07     ` Luiz Augusto von Dentz
2023-02-13 22:20   ` patchwork-bot+bluetooth
2023-02-01 18:41 ` [PATCH BlueZ] media: set default value for BAP endpoint Vendor field Pauli Virtanen
2023-02-01 19:10   ` Luiz Augusto von Dentz
2023-02-01 19:51   ` Pauli Virtanen [this message]
2023-02-01 21:14     ` [BlueZ,v2] " bluez.test.bot
2023-02-01 21:50     ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
2023-02-01 20:05   ` [BlueZ] " bluez.test.bot
2023-02-11 10:53 ` [PATCH BlueZ v2 1/9] doc: remove unimplemented Quality Report from MGMT settings Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 2/9] doc: add MGMT setting for CIS features Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 3/9] lib: Add defines for MGMT setting bits for CIS feature support Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 4/9] monitor: add MGMT setting bit names " Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 5/9] tools/btmgmt: " Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 6/9] adapter: add function for checking adapter features, add CIS features Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 7/9] media: Check adapter CIS support to add BAP in SupportedUUIDs Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 8/9] shared/bap: support client-only case Pauli Virtanen
2023-02-11 10:53   ` [PATCH BlueZ v2 9/9] bap: handle adapters that are not CIS Central / Peripheral capable Pauli Virtanen
2023-02-11 13:45   ` [BlueZ,v2,1/9] doc: remove unimplemented Quality Report from MGMT settings bluez.test.bot
2023-02-13 22:20   ` [PATCH BlueZ v2 1/9] " patchwork-bot+bluetooth
2023-02-13 22:30     ` 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=26d36cc8d645773b6795a18355631134bf2bd074.1675281104.git.pav@iki.fi \
    --to=pav@iki.fi \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.