diff mbox series

[BlueZ] advertising: Fix peripheral adverts when Discoverable = false

Message ID 20230728105604.948472-1-simon.mikuda@streamunlimited.com (mailing list archive)
State Accepted
Commit 828bc564e6e84fc0499f2e3a99438240e4ff6de7
Headers show
Series [BlueZ] advertising: Fix peripheral adverts when Discoverable = false | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Simon Mikuda July 28, 2023, 10:56 a.m. UTC
There is a problem with this configuration: Type = peripheral,
Discoverable = false and Adapter is discoverable

In this state device will start advertise discoverable advertisements
even when user wanted non-discoverable advertisements.

This change will add empty Flags when "Discoverable" parameter is set.
---
 src/advertising.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

bluez.test.bot@gmail.com July 28, 2023, 12:19 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=770527

---Test result---

Test Summary:
CheckPatch                    PASS      0.53 seconds
GitLint                       PASS      0.37 seconds
BuildEll                      PASS      32.33 seconds
BluezMake                     PASS      967.12 seconds
MakeCheck                     PASS      13.52 seconds
MakeDistcheck                 PASS      184.18 seconds
CheckValgrind                 PASS      303.51 seconds
CheckSmatch                   PASS      401.78 seconds
bluezmakeextell               PASS      122.84 seconds
IncrementalBuild              PASS      791.91 seconds
ScanBuild                     PASS      1251.06 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org July 28, 2023, 10:50 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 28 Jul 2023 12:56:04 +0200 you wrote:
> There is a problem with this configuration: Type = peripheral,
> Discoverable = false and Adapter is discoverable
> 
> In this state device will start advertise discoverable advertisements
> even when user wanted non-discoverable advertisements.
> 
> This change will add empty Flags when "Discoverable" parameter is set.
> 
> [...]

Here is the summary with links:
  - [BlueZ] advertising: Fix peripheral adverts when Discoverable = false
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=828bc564e6e8

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/advertising.c b/src/advertising.c
index d959bf38f..2c9a5a443 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -727,11 +727,6 @@  fail:
 
 static bool set_flags(struct btd_adv_client *client, uint8_t flags)
 {
-	if (!flags) {
-		bt_ad_clear_flags(client->data);
-		return true;
-	}
-
 	/* Set BR/EDR Not Supported for LE only */
 	if (!btd_adapter_get_bredr(client->manager->adapter))
 		flags |= BT_AD_FLAG_NO_BREDR;
@@ -1447,7 +1442,8 @@  static DBusMessage *parse_advertisement(struct btd_adv_client *client)
 		}
 	}
 
-	if (bt_ad_has_flags(client->data)) {
+	if (bt_ad_get_flags(client->data) &
+			(BT_AD_FLAG_GENERAL | BT_AD_FLAG_LIMITED)) {
 		/* BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part C
 		 * page 2042:
 		 * A device in the broadcast mode shall not set the