summaryrefslogtreecommitdiff
path: root/src/advertising.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-08-10 14:50:16 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-08-10 14:50:16 -0700
commited664d9897b92cf117445dd141ffc6891d305f51 (patch)
tree0ff33f706a460c2965eddee0ba57d8011944ff99 /src/advertising.c
parent6fb2f1aa5f60b746c1037ac12720915bd87705f2 (diff)
downloadbluez-ed664d9897b92cf117445dd141ffc6891d305f51.tar.gz
advertising: Fix failing to advertise with Includes=local-name
When local-name is set MGMT_ADV_FLAG_LOCAL_NAME would be set which would be sent with MGMT_OP_ADD_EXT_ADV_PARAMS but latter one it would be overwrite in generate_scan_rsp.
Diffstat (limited to 'src/advertising.c')
-rw-r--r--src/advertising.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/advertising.c b/src/advertising.c
index 70e60601d..bd79454d5 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -774,21 +774,14 @@ static uint8_t *generate_adv_data(struct btd_adv_client *client,
static uint8_t *generate_scan_rsp(struct btd_adv_client *client,
uint32_t *flags, size_t *len)
{
- struct btd_adv_manager *manager = client->manager;
- const char *name;
-
- if (!(*flags & MGMT_ADV_FLAG_LOCAL_NAME) && !client->name) {
+ if (!client->name) {
*len = 0;
return NULL;
}
*flags &= ~MGMT_ADV_FLAG_LOCAL_NAME;
- name = client->name;
- if (!name)
- name = btd_adapter_get_name(manager->adapter);
-
- bt_ad_add_name(client->scan, name);
+ bt_ad_add_name(client->scan, client->name);
return bt_ad_generate(client->scan, len);
}