| c94cdbc6 |
btdev: Add support for setting bdaddr
This adds btdev_set_bdaddr so it is possible to set an arbritrary
address. |
Luiz Augusto von Dentz |
3 years ago |
2 files, +12, -0 |
| 3da439ae |
shared/bap: Fixing memory overwrite during ASE Enable Operation
This fixes memory overwrite during ASE Enable operation handling.
It avoids crashing of bluetoothd if metadata of more than sizeo of
size_t is received.
This also fixes storing metadata to stream structure. |
Abhay Maheta |
3 years ago |
1 file, +6, -2 |
| dabf32b3 |
mesh: Fix msg cache ring buffer
The message cache should be a strict ring buffer, suppressed message
should not move to the front of the queue. |
Isak Westin |
3 years ago |
1 file, +1, -2 |
| fc598fa1 |
tools: mgmt-tester - Test for HCI cmd after static addr set
This change checks for the expected HCI command after Static Address
change requested. |
Brian Gix |
3 years ago |
1 file, +6, -0 |
| 838ddc93 |
mesh: provisionee: Check prov start parameters
Verify that all parameters in a Provisioning Start PDU are valid, also
compared to the capabilities that has been sent. |
Isak Westin |
3 years ago |
1 file, +46, -11 |
| 77da94eb |
mesh: provisionee: Handle failed provisioning
When a provisioning fails, all additionally received PDU should be
unexpected until link is closed by provisioner. See MshPRFv1.0.1 section
5.4.4. |
Isak Westin |
3 years ago |
1 file, +6, -1 |
| c1f1a49a |
mesh: provisionee: Handle unknown PDUs
If an unknown PDU is received during provisioning, the provisioning
should fail with "Invalid PDU". |
Isak Westin |
3 years ago |
1 file, +7, -2 |
| 95bf980b |
mesh: Update Key Refresh flag after provision
The Key Refresh flag in the Secure Network beacon is now correctly
updated based on provisioning data after being successfully provisioned. |
Isak Westin |
3 years ago |
1 file, +2, -2 |
| c89e9c4b |
mesh: Always relay messages from Low Power nodes
If we receive a message from one of our Low Power nodes, which is
encrypted using frendship credentials and where the destination is not
us, we must relay that message using master credentials.
See MshPRFv1.0.1 section 3.6.6.2. |
Isak Westin |
3 years ago |
1 file, +36, -11 |
| 3f3a7b8e |
mesh: Queue a friend update on IV Update change
A friend update should be queued when we receive a Secure Network beacon
that changes the IV Update state. |
Isak Westin |
3 years ago |
1 file, +1, -0 |
| 7ff3e10d |
mesh: Verify padding bits in Friend Poll messages
The padding bits in a Friend Poll message must be zero.
See MshPRFv1.0.1 section 3.6.5.1. |
Isak Westin |
3 years ago |
1 file, +1, -1 |
| e9a8e884 |
mesh: Correct size of friend cache
The cache size communicated to the Low Power node should be the same as
the cache size actually used. |
Isak Westin |
3 years ago |
1 file, +1, -1 |
| e71e1103 |
mesh: Fix mesh to work with MESH_IO_TYPE_UNIT_TEST
This fixes mesh io flow for MESH_IO_TYPE_UNIT_TEST which
got broken after:
commit 9966cb8b6999a5f54fc13acbd7e1526512a84342
("mesh: Add new kernel MGMT based IO transport") |
Inga Stotland |
3 years ago |
2 files, +8, -2 |
| fe942704 |
README: Update Mesh required Kernel Config section
Add CONFIG_CRYPTO_USER_API_SKCIPHER to the list of the required
.config options |
Inga Stotland |
3 years ago |
1 file, +1, -0 |
| 1f6553ed |
build: Deprecate meshctl tool
This marks meshctl tool as deprecated since it is not longer
maintained. |
Inga Stotland |
3 years ago |
1 file, +5, -2 |
| 291cff06 |
mesh: Allow Key Refresh Phase 0 to 3 transition
Transition to Phase 3 from Phase 0 does not cause any state change, but
is a valid transition. See MshPRFv1.0.1 section 4.2.14. |
Isak Westin |
3 years ago |
1 file, +4, -0 |
| 9d22d542 |
mesh: Allow Key refresh to skip Phase 2
If we are in Key Refresh Phase 1, and receive a Secure Network beacon
using the new NetKey and with KR flag set to 0, Phase 2 should be
skipped. See MshPRFv1.0.1 section 3.10.4.1. |
Isak Westin |
3 years ago |
1 file, +3, -2 |
| 7d050890 |
mesh: Ignore SNB with invalid IV Index values
If we are in IV update in progress state, and receive a Secure Network
beacon with an IV index equal to last known IV index + 1, and IV update
flag set to 1, it should be ignored. See MshPRFv1.0.1 section 3.10.5. |
Isak Westin |
3 years ago |
1 file, +4, -0 |
| 926d16db |
mesh: Ignore Secure Network Beacon from subnet
If this node is a member of a primary subnet and receives a Secure Network
beacon on a secondary subnet with an IV Index greater than the last known
IV Index of the primary subnet, the Secure Network beacon shall be ignored.
See MshPRFv1.0.1 section 3.10.5. |
Isak Westin |
3 years ago |
1 file, +12, -1 |
| 25a31f5a |
client/player: Fix attempting to acquire already acquired transport
If the transport has links check if the link is acquiring before
attempting to call Acquire otherwise it may cause an error to be
printed. |
Luiz Augusto von Dentz |
3 years ago |
1 file, +65, -5 |
| 3b47cf5d |
tools: Fix mesh-tester to expect end of ADV
Tester was failing by not clearing the HCI queue of expected events |
Brian Gix |
3 years ago |
1 file, +12, -0 |
| 293d670f |
monitor/packet: Fix scan-build warnings
This fixes the following warnings:
monitor/packet.c:410:4: warning: Value stored to 'ts_pos' is never read
[deadcode.DeadStores]
ts_pos += n;
^ ~
monitor/packet.c:455:4: warning: Value stored to 'pos' is never read
[deadcode.DeadStores]
pos += n;
^ ~
monitor/packet.c:7477:2: warning: Value stored to 'mask' is never read
[deadcode.DeadStores]
mask = tx_phys;
^ ~~~~~~~
monitor/packet.c:7485:2: warning: Value stored to 'mask' is never read
[deadcode.DeadStores]
mask = rx_phys;
^ ~~~~~~~
monitor/packet.c:11229:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoA Constant Tone Extension";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11232:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoA Constant Tone Extension with 1us slots";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11235:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "AoD Constant Tone Extension with 2us slots";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11238:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "No Constant Tone Extension";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11241:3: warning: Value stored to 'str' is never read
[deadcode.DeadStores]
str = "Reserved";
^ ~~~~~~~~~~
monitor/packet.c:11242:3: warning: Value stored to 'color_on' is never read
[deadcode.DeadStores]
color_on = COLOR_RED;
^ ~~~~~~~~~ |
Luiz Augusto von Dentz |
3 years ago |
1 file, +4, -12 |
| 643b074d |
monitor/analyze: Fix scan-build warnings
This fixes the following warnings:
monitor/analyze.c:381:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:382:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:398:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:399:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:418:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:419:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*evt);
^ ~~~~~~~~~~~~
monitor/analyze.c:527:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(subtype);
^ ~~~~~~~~~~~~~~~
monitor/analyze.c:528:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(subtype);
^ ~~~~~~~~~~~~~~~
monitor/analyze.c:629:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:630:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:646:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:647:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:710:2: warning: Value stored to 'data' is never read
[deadcode.DeadStores]
data += sizeof(*hdr);
^ ~~~~~~~~~~~~
monitor/analyze.c:711:2: warning: Value stored to 'size' is never read
[deadcode.DeadStores]
size -= sizeof(*hdr);
^ ~~~~~~~~~~~~ |
Luiz Augusto von Dentz |
3 years ago |
1 file, +0, -28 |
| de190156 |
rctest: Fix scan-build warning
This fixes the following warning:
tools/rctest.c:131:2: warning: 1st function call argument is an
uninitialized value [core.CallAndMessage]
sdp_list_free(protos, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Luiz Augusto von Dentz |
3 years ago |
1 file, +1, -1 |
| d763bfa4 |
mesh: Clear HB sub status field if disabled
When replying to a HB subscription get message, and the current state of
source or destination fields is zero (which means that HB subscription
is disabled), all fields in the status reply should be zero. |
Isak Westin |
3 years ago |
1 file, +24, -2 |
| 902389f3 |
mesh: Correct HB sub state updates
If heartbeat subscription is disabled, all fields should be set to zero
but collected data should be preserved. If HB subscription is enabled,
the collected data should be reset (which includes Min Hops = 0x7f).
HB subscription is disabled by setting any of the following fields to
zero: Source, destination or period log.
HB subscription is enabled by setting all the same fields to valid values. |
Isak Westin |
3 years ago |
2 files, +5, -17 |
| 1ef221ca |
mesh: Reply to HB pub set with same fields
If a Config Heartbeat Publication Set message is unsuccessfully
processed, the fields in the status reply should be the same as in the
original message. See MshPRFv1.0.1 section 4.4.1.2.15. |
Isak Westin |
3 years ago |
1 file, +11, -1 |
| 5b569e3d |
mesh: Correct u32 to u8 log transformation
Fixed the log transformation to correctly follow the value mapping
defined in the mesh profile (section 4.1.2). |
Isak Westin |
3 years ago |
1 file, +4, -4 |
| 9966cb8b |
mesh: Add new kernel MGMT based IO transport
1. Re-structures MGMT handling such that it is used to detect kernel
support of the mesh MGMT opcodes and events before selecting between
using MGMT or the legacy raw HCI socket method.
2. Re-structures main() to allow command line to prefer MGMT over HCI or
visa versa, plus optionally pass an explicte controller.
3. Adds mesh-io-mgmt as a transport. |
Brian Gix |
3 years ago |
13 files, +1154, -141 |
| 491be481 |
mesh: Improve PB-ADV timing for reliability
Because provisioning is not speed dependent, Timing on outbound PB-ADV
packets have been modified to be less likely missed by remote controlers
with looser timing capabilities. |
Brian Gix |
3 years ago |
1 file, +6, -3 |
| 7738e9ac |
tools/mpris-proxy: unregister object path if player registration fails
The `owner' string, passed as user data, is freed if the player fails
registration, but the object path still exists. Upon program exiting,
the lingering path will be enumerated and the attached user data will be
freed again. |
Haochen Tong |
3 years ago |
1 file, +1, -0 |
| e01e8917 |
tools: fix printf format strings
time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now |
Christian Eggers |
3 years ago |
2 files, +6, -4 |
| fa8411cf |
monitor: fix printf format strings
time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now |
Christian Eggers |
3 years ago |
2 files, +18, -13 |
| 7b07f1f9 |
client/player: fix printf format string
Use macros from inttypes.h for correct printf format specifier for
int64_t |
Christian Eggers |
3 years ago |
1 file, +2, -2 |
| 6c712030 |
client/gatt: Fix scan-build warning
This fixes the following warning:
client/gatt.c:2146:2: warning: Null pointer passed to 2nd parameter
expecting 'nonnull' [core.NonNullParamChecker]
memcpy(*dst_value + offset, src_val, src_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Luiz Augusto von Dentz |
3 years ago |
1 file, +2, -1 |
| 15895e40 |
battery: provided_battery_property_changed_cb: check iterator
The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--src/battery.c::provided_battery_property_changed_cb(, , iter, );
+--dbus_message_iter_get_arg_type(iter);
... |
Christian Eggers |
3 years ago |
1 file, +6, -4 |
| f5cbe08a |
gatt: proxy_property_changed: check for NULL iterator
The passed iterator can be NULL as in
src/gatt-database.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--client/gatt.c::property_changed_cb(..., ..., iter, ...);
+--dbus_message_iter_get_arg_type(iter);
... |
Christian Eggers |
3 years ago |
1 file, +11, -9 |
| ee750bba |
client/gatt: proxy_property_changed: check for NULL iterator
The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--client/gatt.c::proxy_property_changed(..., ..., iter, ...);
+--dbus_message_iter_get_arg_type(iter);
... |
Christian Eggers |
3 years ago |
1 file, +10, -7 |
| 47346e53 |
advertising: parse_tx_power: reset value if iter is NULL
Set property to its default value (as done in all other methods listed
in parsers[]). |
Christian Eggers |
3 years ago |
1 file, +3, -1 |
| a18d6686 |
advertising: parse_[min|max]_interval: reset value if iter is NULL
Set property to its default value (as done in all other methods listed
in parsers[]). |
Christian Eggers |
3 years ago |
1 file, +3, -1 |
| abfb3a80 |
advertising: parse_min_interval: reset min_interval if iter is NULL
Set property to its default value (as done in all other methods listed
in parsers[]). |
Christian Eggers |
3 years ago |
1 file, +3, -1 |
| 732eaa7c |
advertising: parse_secondary: check for NULL iterator
The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
proxy->prop_func(..., ..., iter=NULL, ...)
+--src/advertising.c::properties_changed(..., ..., iter, ...);
+--parse_secondary(iter, ...);
... |
Christian Eggers |
3 years ago |
1 file, +6, -0 |
| 2e432781 |
advertising: parse_secondary: fix mask value
It looks like a wrong mask value is used here as only the bits mentioned
in adv_secondary::flag can be set again within the loop.
Replace magic number by preprocessor macro. |
Christian Eggers |
3 years ago |
1 file, +1, -1 |
| 47821c47 |
advertising: parse_secondary: fix loop condition
"secondary" isn't an array of pointers, so the iterator can never be
NULL. |
Christian Eggers |
3 years ago |
1 file, +1, -1 |
| 95d9dc67 |
mesh: Reply error if appkey added for wrong netkey
If a known appkey is added for a different netkey, the status reply
should be Invalid NetKey. |
Isak Westin |
3 years ago |
1 file, +3, -1 |
| 32d866b4 |
mesh: Clear addr field if virt sub failed
If processing failed for a Config Model Subscription Virtual Address
Add/Delete/Overwrite message, the address field in the status reply
should be set to zero. See MshPRFv1.0.1 section 4.4.1.2.8. |
Isak Westin |
3 years ago |
1 file, +4, -0 |
| 721d5a8a |
lib: Add defines of new MGMT opcodes and events
Populated new opcodes and events into static mgmt_ev and mgmt_op string
arrays. |
Brian Gix |
3 years ago |
1 file, +6, -0 |
| 0454e2d0 |
mgmt: Add support for Mesh in the kernel
These commands and events allow User space apps to test for Mesh
support, and request incoming mesh packets be delivered and request
outbound mesh packets to be sent. This is the basis for sharing
one controller between the legacy bluetoothd daemon and the mesh
bluetooth-meshd daemon. |
Brian Gix |
3 years ago |
1 file, +157, -35 |
| c9fadca7 |
mesh: Remove RFU check for publication set
It is not stated in the mesh profile that the RFU bits in a Model
Publication Set message have to be zero. In fact, PTS test
MESH/NODE/CFG/MP/BV-01-C is sending that command with non-zero RFU and
expects a reply. |
Isak Westin |
3 years ago |
1 file, +0, -2 |
| b72edcc5 |
mesh: Do not accept publication for unbound appkey
If a user tries to configure publication of a model with an appkey that
is not bound to that model, an error should be returned. |
Isak Westin |
3 years ago |
1 file, +2, -1 |