From: Luiz Augusto von Dentz Date: Tue, 10 Aug 2021 21:50:16 +0000 (-0700) Subject: advertising: Fix failing to advertise with Includes=local-name X-Git-Tag: submit/tizen/20220313.220938~227 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5246c4f44d618a2ed59fdb4fae39855d15aa219;p=platform%2Fupstream%2Fbluez.git 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. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/src/advertising.c b/src/advertising.c index bc32ebf..35d61b4 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -769,21 +769,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); }