This adds support for LE Set Privacy mode which is required when using
Device Privacy mode:
< HCI Command: LE Set Priva.. (0x08|0x004e) plen 8
Peer Identity address type: Public (0x00)
Peer Identity address: BC:9A:78:56:34:12 (OUI BC-9A-78)
Privacy Mode: Use Device Privacy (0x01)
> HCI Event: Command Complete (0x0e) plen 4
LE Set Privacy Mode (0x08|0x004e) ncmd 1
This fixes the following memory leak as a result of not freeing
app->proxies:
160 (32 direct, 128 indirect) bytes in 1 blocks are definitely lost in
loss record 218 of 261
at 0x484086F: malloc (vg_replace_malloc.c:381)
by 0x1CF80E: btd_malloc (util.c:33)
by 0x1CF24D: queue_new (queue.c:47)
by 0x144DB9: create_app (media.c:2262)
by 0x144DB9: register_app (media.c:2322)
by 0x1CC148: process_message (object.c:246)
atoi doesn't support values entered in hexadecimal (0x...) which is
likely the prefered format for the likes of handles, etc, so this
replaces the uses of atoi with strtol.
Sometimes, on connection error, this gets called and frees the device
when midi_disconnect() was not called which would leave ALSA sequencer
objects leaking.
Introducing PeripheralLongTermKey group for storing LTK info to
replace the less inclusive term. Currently we still need to write/read
from both to ensure smooth transition, but later we should deprecate
the old term.
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Device privacy 0x01 uses RPA regardless of the discoverable setting thus
it conforms to network mode not device mode.
Also this improves documentation to state what is the expectation of
each mode since it may not have been very clear by just using the terms
from the spec.
This patch updates the expected manufacturer of the emulator for the
following test cases:
> Read Ext Controller Info 1 Failed
> Read Ext Controller Info 2 Failed
> Read Ext Controller Info 3 Failed
> Read Ext Controller Info 4 Failed
> Read Ext Controller Info 5 Failed
When trying to loads contents from file using g_key_file_load_from_file
it may cause an error which needs to be cleared since the gerr is
reused, also make sure the file is always created upfront to avoid
having such error when storage has not been initialized.
Adds missing assignment to disconn_id for pending operations and removes
check that is already handled by checking if the owner_queue of the op
is gone at the start of write_reply_cb.
When storing an IRK the storage file may not have been created yet
since that uses the device address which is likely changed to the
identity address causing the following trace:
Invalid read of size 8
at 0x196452: store_irk.constprop.0 (adapter.c:8679)
by 0x198C92: new_irk_callback (adapter.c:8737)
by 0x1CF6DC: queue_foreach (queue.c:207)
by 0x1D1394: process_notify (mgmt.c:308)
by 0x1D1394: can_read_data (mgmt.c:374)
by 0x1E0634: watch_callback (io-glib.c:157)
by 0x4954A9E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6600.8)
by 0x49A6A97: ??? (in /usr/lib64/libglib-2.0.so.0.6600.8)
by 0x4954162: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.6600.8)
by 0x1E0CD4: mainloop_run (mainloop-glib.c:66)
by 0x1E10B1: mainloop_run_with_signal (mainloop-notify.c:188)
by 0x12E3FC: main (main.c:1210)
Address 0x6534418 is 8 bytes inside a block of size 16 free'd
This adds the initial support for MSFT vendor commands and enable them
when in btvirt:
< HCI Command: Microsoft Ex.. (0x3f|0x001e) plen 1
Read Supported Features (0x00)
> HCI Event: Command Complete (0x0e) plen 14
Microsoft Extension (0x3f|0x001e) ncmd 1
Read Supported Features (0x00)
Status: Success (0x00)
Features: 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
RSSI Monitoring feature for BR/EDR
RSSI Monitoring feature for LE connections
RSSI Monitoring of LE advertisements
Advertising Monitoring of LE advertisements
Verifying the validity of P-192 and P-256 keys
Continuous Advertising Monitoring
Event prefix length: 0
Event prefix:
< HCI Command: Microsoft Ex.. (0x3f|0x001e) plen 2
LE Set Advertisement Filter Enable (0x05)
Enable: All filter conditions (0x01)
> HCI Event: Command Complete (0x0e) plen 5
Microsoft Extension (0x3f|0x001e) ncmd 1
LE Set Advertisement Filter Enable (0x05)
Status: Success (0x00)
This makes the emulator use Linux Foundation manufacturer id which
shall be simpler to distinguish emulator instances since it is unlikely
there will be other vendors using it.
This patch fixes the build error due to missing ell/cleanup.h.
./ell/util.h:33:10: fatal error: ell/cleanup.h: No such file or directory
33 | #include <ell/cleanup.h>
| ^~~~~~~~~~~~~~~
This replaces the direct setting debugfs to use vhci instance which
properly stores the controller index so it can be used even if there
are real controllers in the system.
The likes of mainloop_add_fd is not implemented in mainloop-glib.c while
io_set_read_handler so this makes it possible to use vhci instance with
both libshared-glib and libshared-mainloop.