A few of the length checks that deal with HCI packets coming from the
controller were using assert statements. But the recommended practice is
to drop invalid packets and continue execution whenever a malformed
packet arrives from an external source, so replace those assert
statements with branches that will drop the packet and return.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Fixed issue when reprovisioning is done on a device with
both RPR client and server on the same device.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
The existing formula for the amount of data that can be filled
in in the current PDU is correct but confusing. Replace it with
a simpler formula.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Updates the chaining for advertising.
Instead of unconditionally adding a new PDU when new data
is added we now instead fill the last PDU in the chain with
the incoming data, only adding a new PDU when there is
not enough room.
This reduces the nr. of PDUs used for advertising, and also
fixes some qualification failures
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The indexes were reset to 0 for each subgroup, which meant
that if we had a broadcast source with 2 subgroups and
1 BIS in each, both of them would use index 0x01.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A race condition between ATT RX and the connection teardown can happen, as
the teardown is executed from a workqueue.
For example:
- connection is established
- `connected` cb is called (in BT RX context)
- user calls `bt_conn_disconnect` in that cb
- connection is marked as disconnecting
- ATT teardown & general conn cleanup is scheduled
- BT RX gets an ATT request, tries to handle it
- ATT bearer is still not GC'd, so it tries and fails to send it
-> results in error message "not connected" on log
- ATT teardown & general conn cleanup runs
To avoid that, we not only check the bearer state, but also its ACL conn
state.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Fix leak in scheduled ticker node when rescheduling ticker
nodes.
Applications having active Extended Advertising or Observer
role with the use of ticker reschedule in window feature
would experience assertion check failure due to delayed
radio event preparation or stalled controller with no active
roles.
Fix updating of the ticker linked list when handling
rescheduled tickers.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use UTC time by default, and add the option to use local time.
Also, change the default formats to comply with ISO-8601.
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
When the legacy LLCP implementation was removed this Kconfig option was
mistakenly left over. Remove it now with all its users.
Fixes#63212.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This module calls `log_output_*` functions so it should enable
the `LOG_OUTPUT` Kconfig option explicitly.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit sets the C/R (command/response) bit when UIH
CMUX frames are sent from the modem_cmux module. This bit
is ignored by some modems like the Quectel BG95, as there
is no defined response to this specific CMUX frame type.
However, other modems, like the TELIT ME910, require the
bit to be set (command). If the bit is not set, the modem
will simply ignore the frame completely.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Make the aa argument const to solve a Coverity issue
that assumes that any value that is being byteswapped
is tainted. Making the argument const should avoid
this assumption from Coverity.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix the coverity issue CWE570, comparison of unsigned int to 0
in the definition of IS_SYNC_ISO_HANDLE
There is a potentially the same issue for IS_ADV_ISO_HANDLE,
fixed that as well
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
`smp_send_pos` is 16 bits wide but it was being
passed as uint8_t, thus truncating.
This made it impossible to receive packets
larger than 256 bytes.
Signed-off-by: Stasys Aužbikas <stasysau@gmail.com>
If RPR server is used then Mesh settings work queue
requires more size during provisioning procedure.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
The check for number of streams in a subgroup was reversed, so
it would never allow for correct values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Currently context->local is not set for offloaded interface.
This change move net_offload_bind call after set of context->local.
Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
Added run-time BT_CENTRAL role check for the path that was
central specific and did not have such check.
When multi-role BT device tried to pair without bonding (peripheral role)
while already previously bonded with the same device on another
Bluetooth identity, pairing failed.
It executed central-specific code, which should not be executed in case
when the device acts as peripheral (as it is even opt-out from code when
CONFIG_BT_CENTRAL is not enabled).
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
In ll_setup_iso_path cis is only ever set if CONFIG_BT_CTLR_CONN_ISO
is enabled, and similarly adv_stream is only ever set if
CONFIG_BT_CTLR_ADV_ISO is enabled.
The two assignments were reported as dead code by Coverity due
to this, which has been fixed by guarding the code with
the respective Kconfigs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
BT_SECURITY_FORCE_PAIR option gets overridden when CONFIG_BT_SMP_SC_ONLY
or CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is defined. Cache the bit value
before overrides.
Add explicit forced pair handling to existing security level check.
Functionality did not change as this was done implicitly due to integer
comparison for enums.
Add extra clarification to the method doc.
Signed-off-by: Rait Rääk <raitraak@gmail.com>
Only confirmable messages need pending tracking. Non-confirmable
messages are released after sending.
Match incoming packets with token, not message ID.
Ignore responses with non-matching tokens.
Remove unused function send_reset().
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
In case observation token changes (the LwM2M server re-sends
observation request to the client), the LwM2M engine should cancel any
ongoing notifications based on the old token. Otherwise, it will be
impossible to match the pending notification reply (ACK) with the
observer context anymore, causing new notifications for this
observation to stall.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove the terminate_ack from struct ll_conn since it is
not used anywhere, and results in dead code.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The remaining bit should be zero if auth is
shorter than PROV_AUTH_MAX_LEN and it should
be trimmed by removing octets with indexes
higher than PROV_AUTH_MAX_LEN.
Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
Zephyr's code base uses MP_MAX_NUM_CPUS to
know how many cores exists in the target. It is
also expected that both symbols MP_MAX_NUM_CPUS
and MP_NUM_CPUS have the same value, so lets
just use MP_MAX_NUM_CPUS and simplify it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The compiler emits a "null where non-null expected" warning unless the
argument of strlen is non-null at compile time.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The maximum size of an extension accept by the shell
was previously a define and is now made configurable through Kconfig.
Signed-off-by: Kai Meinhard <meinhard@gessler.de>
Always clone net_pkt to pass to promiscuous queue.
Previously, net_pkt was passed to L2 before conditionally cloning.
But L2 would in some cases strip ethernet headers, so cloned
net_pkt received through promiscuous interface would be missing headers.
Signed-off-by: Kieran Tyrrell <kieran@sienda.com>
The mode command operation has to be set to WIFI_MGMT_GET when the
option -g is provided. It was mistakenly set to true. Correcting the
same
This PR fixes#63424 and sets the proper value for the get command
Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
Fix issues when setting new values in cfg that modify
the length of the codec configuration LTV value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added comment to KConfig.iso file to make description
of BT_ISO_TX_MTU and BT_ISO_RX_MTU more clear
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
iso_has_ts wasn't set correcrly for fragments of HCI ISO Data packets,
now it is set depending on timestamp
provided in the original buffer provided by host user
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
this commit partially reverts e460847b60
According to Core Spec 5.4, Vol. 4, Part E, 5.4.5, Data_Total_Length field
contains length of the whole packet including optional fields of SDU
(Time_Stamp, Packet_Sequence_Number, ISO_SDU_Length, RFU and
Packet_Status_Flag). In Zephyr Host, Data_Total_Length value
is stored in bt_dev.le.iso_mtu field.
Therefore, there is no need to calculate iso_hdr_len(),
this length is already taken into account in conn_mtu(conn).
This commits removes iso_hdr_len() function and fixes
calculation of HCI ISO Data packet length calculations.
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
Fix number of completed packets generated when BIS HCI ISO
Data packets sent to Controller are in fragments. Use the
ISOAL stored sdu_fragment count to generate the number of
completed packets count.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Kconfig option to turn off ISO Data Packet Sequence Number
use to place the ISO Data in the correct radio event,
instead simply buffer it to next radio event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISO data timestamp to reflect the SDU reference point
and not the ISO event anchor point when PDUs received after
retransmissions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use of payload_count for supporting flush timeout in
Central and Peripheral ISO Lower Link Layer.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Do not explicitly check buf parameter in usbh_req_setup()
but add ASSERT to check unresolved data stage conditions.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add command to get the current device configuration.
Revise the shell part to have a set|get configuration
subcommands.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
With the latest change, there is no need for this structure
to be used as a completion handler.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>