Since 4e111f3448, when another adapter is
found, the default adapter would be changed, which is not expected.
Default adapter can only be changed by select command.
During the course of bt_io_accept the setup can be freed causing the
callback to be called which can lead to the following crash:
bluetoothd[853]: profiles/audio/a2dp.c:setup_unref() 0x8183c1c0: ref=0
bluetoothd[853]: profiles/audio/a2dp.c:setup_free() 0x8183c1c0
...
bluetoothd[853]: HUP or ERR on socket: Connection reset by peer (104)
bluetoothd[853]: profiles/audio/a2dp.c:setup_unref() 0x8183c1c0: ref=-80438434
bluetoothd[853]: profiles/audio/a2dp.c:setup_free() 0x8183c1c0
0 0x80106888 in stream_free ()
1 0xb7621d49 in g_slist_foreach () from /usr/lib/libglib-2.0.so.0
2 0xb7621d92 in g_slist_free_full () from /usr/lib/libglib-2.0.so.0
3 0x80107d09 in avdtp_unref ()
4 0x8010273b in setup_unref ()
5 0x80104c54 in transport_cb ()
6 0x80136a9c in accept_cb ()
This adds 'security' command which can be used to display and change
the provision security level:
[meshctl]# security
Provision Security Level set to 1 (medium)
[meshctl]# security 2
Provision Security Level set to 2 (high)
Note: This doesn't change the default which is still medium.
Since essencially what this filter would be doing is disable duplicate
for data use it instead of ResetData.
Also inline the documentation of each filter option to make it easier to
read what each option does.
For some commands bluetoothctl gives the hint of argument, which is "on"
and "off", it is convenient even if the argument of command was overlooked
in help message.
The following crash happens if user shutdown the its pipe before the
device gets disconnected:
Invalid read of size 8
at 0x4E47ED: io_shutdown (io-glib.c:285)
by 0x4D1366: queue_remove_all (queue.c:351)
by 0x4A1D22: btd_gatt_client_disconnected (gatt-client.c:2207)
by 0x4A517B: att_disconnected_cb (device.c:4663)
by 0x4D5945: disconn_handler (att.c:538)
by 0x4D0FBF: queue_foreach (queue.c:220)
by 0x4D75D9: disconnect_cb (att.c:590)
by 0x4E419A: watch_callback (io-glib.c:170)
by 0x50CD246: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x50CD5E7: ??? (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x50CD901: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x40CD0E: main (main.c:781)
Address 0x9240bc8 is 8 bytes inside a block of size 40 free'd
at 0x4C2FD18: free (vg_replace_malloc.c:530)
by 0x50D2B4D: g_free (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x4E4200: io_unref (io-glib.c:68)
by 0x4E4257: watch_destroy (io-glib.c:107)
by 0x50C9C67: ??? (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x50CD27B: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x50CD5E7: ??? (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x50CD901: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5200.3)
by 0x40CD0E: main (main.c:781)
If there are multiple adapters, bluetoothctl may choose the wrong
advertising manager. In addition, select command cannot update
current advertising manager when choosing another adapter. Therefore, we
need to put advertising manager under adapter structure to resolve this
issue.
Changes introduced by ef024c2c44 have a
regression were a proxy may not be appended to the proxy_list causing
tests to fail as the proxies maybe be added multiple time since
proxy_look would not be able to find existing instances.
This allows bluetoothd to detect changes done by the user without
having to rely on advertise command to unregister and register again:
bluetooth]# set-advertise-name blah
[bluetooth]# advertise on
@ MGMT Command: Add Advertising (0x003e) plen 17
Instance: 1
Flags: 0x00000003
Switch into Connectable mode
Advertise as Discoverable
Duration: 0
Timeout: 0
Advertising data length: 0
Scan response length: 6
Name (complete): blah
[bluetooth]# set-advertise-name bleh
@ MGMT Command: Add Advertising (0x003e) plen 17
Instance: 1
Flags: 0x00000003
Switch into Connectable mode
Advertise as Discoverable
Duration: 0
Timeout: 0
Advertising data length: 0
Scan response length: 6
Name (complete): bleh
The flag to include an Appearance may not be available in older kernels
so instead of depending on the kernel to add it just generate it locally
and add as part of advertising data:
@ MGMT Command: Add Advertising (0x003e) plen 15
Instance: 1
Flags: 0x00000003
Switch into Connectable mode
Advertise as Discoverable
Duration: 0
Timeout: 0
Advertising data length: 4
Appearance: Unknown (0x0000)
Scan response length: 0
The flag to include Local Name may not be available in older kernel so
instead of depending on the kernel to add the adapter name in the scan
response generate it and set it as instance scan response:
@ MGMT Command: Add Advertising (0x003e) plen 31
Instance: 1
Flags: 0x00000003
Switch into Connectable mode
Advertise as Discoverable
Duration: 0
Timeout: 0
Advertising data length: 0
Scan response length: 20
Name (complete): Vudentz's T460s #1