diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-03-11 14:27:42 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-03-11 14:27:42 +0200 |
commit | dcf9c2a9aadf2ad766ea2fefa0a9e7d745a68cc2 (patch) | |
tree | 9108f5af2553562f7e7c1884a54dfe163bab2fbf /emulator/btdev.c | |
parent | a37c747a597c540f300ae6f59d60a388f0ee655d (diff) | |
download | bluez-dcf9c2a9aadf2ad766ea2fefa0a9e7d745a68cc2.tar.gz |
emulator/btdev: Fix using correct address in advertising reports
Diffstat (limited to 'emulator/btdev.c')
-rw-r--r-- | emulator/btdev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c index 8fc4c96ff..a08734604 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -1386,7 +1386,11 @@ static void le_send_adv_report(struct btdev *btdev, const struct btdev *remote, memset(&meta_event.lar, 0, sizeof(meta_event.lar)); meta_event.lar.num_reports = 1; meta_event.lar.event_type = type; - memcpy(meta_event.lar.addr, remote->bdaddr, 6); + meta_event.lar.addr_type = remote->le_adv_own_addr; + if (remote->le_adv_own_addr == 0x00) + memcpy(meta_event.lar.addr, remote->bdaddr, 6); + else + memcpy(meta_event.lar.addr, remote->random_addr, 6); /* Scan or advertising response */ if (type == 0x04) { |