DAD creates an entry in the neighbor cache for the queried (own)
address. In case the address is removed from the interface while DAD is
still incomplete, we need to remove the corresponding cache entry (just
like in case of DAD timeout) to avoid stale entries in the cache.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Errors were logged for some cases in zephyr_img_mgmt.c, but not all.
This commit adds error logs for all error cases.
Signed-off-by: Nick Brook <nrbrook@gmail.com>
When `bt_le_oob_get_local` or `bt_le_ext_adv_oob_get_local` is called
and SMP is enabled, `bt_smp_le_oob_generate_sc_data` is called to
generate a Random Number and a Confirmation Value needed for OOB data.
These values are based on the device's public key.
The public key is generated only once when `bt_smp_init` is called.
If public key generation fails, the callback passed to `bt_pub_key_get`
is called with `pkey` set to NULL. The `bt_smp_pkey_ready` callback
gets called, but it doesn't release the `sc_local_pkey_ready` semaphore
thus leaving `bt_smp_le_oob_generate_sc_data` wait for semaphore with
`K_FOREVER`.
This commit replaces the semaphore with a conditional variable and
requests a public key again if the key is NULL thus solving 2 issues:
- handling the case where the callback was triggered notifying about the
completion of the public key request, but the key was not generated,
- handling the case where multiple threads trying to acquire the same
sempahore.
The timeout is used instead of K_FOREVER to avoid cases when callback
has never been triggered.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Calling coap_client_cancel_requests() clears the internal request
context only for active requests (i. e. not replied yet). However,
if there are any pending request context monitoring ACK duplicates,
those would still make the corresponding client socket being monitored
by poll(). In result, when application closes the socket, the polling
thread will throw POLLNVAL error for the socket.
Fix this, by resetting all request contexts unconditionally. The request
callback will only be called for the active requests.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In function `avdtp_send`, there is case that if the session->req is not
NULL, then the buf will be lost.
Release the allocated buffer by buffer allocated function when the buf
is failed to send.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Otherwise the RTIO Workqueue is not functional for devices during init.
An example of this issue is devices using SPI transfers with default
spi_rtio.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
When the stream enters the idle state, some values were not
properly reset (e.g. the stream->ep).
Use the bt_bap_stream_detach function to clean up the stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix regression in scan aux release now that aux context is
retrieved from the node rx when supporting multiple chain
reception.
Relates to commit a8065926ac ("Bluetooth: Controller: Fix
to release aux context stored in node rx").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Commit removes weak attribute and renames some functions
in crypto_psa.c since there is no centralized distribution
of the PSA key ID in bsim tests and no necessity to
reimplement native mesh approach.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Typically, when shell logging backend is used user wants to get
logs on shell instances so do not enable raw RTT log backend in
that case. When raw backend is enabled then initial logs go to
RTT backend and they are not visible on shell which starts later
as it requires additional thread.
It can be assumed that when RTT backend is used it will be
explicitly enabled by the user.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Remove the CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM macro in L2 shell level
to make 11v BTM query support embedded supplicant.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
The unicast server does not need GATT caching and it was likely
incorrectly added earlier as a dependency.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of providing NULL for bt_gatt_notify_uuid we
iterate on the connection objects and ensure that we
properly truncate the notification based on each
connection's GATT MTU.
This ensures that we send the right size for all
connections.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a common function to get the maximum notification
size, instead of having multiple implementations of this.
Ideally this function should be moved to the GATT API,
but for now just implement it for LE audio and then move to
GATT later.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added missing documentation for
bt_ccp_call_control_client_discover.
Added missing handling of -ENOTCONN in the function as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The total attributes list bytes count is only used to check the tail
room of response buffer. And the remaining frame length is used to
copy data from receiving buffer.
It does not check whether the remaining frame length is consistent with
the total attributes list bytes count.
Add the checking to make sure the attributes list is complete. And it
is used to make sure the response buffer can be accessed safety.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
According to RFC 4861, ch. 7.2.5:
"If the Override flag is set, or the supplied link-layer address
is the same as that in the cache, or no Target Link-Layer Address
option was supplied, the received advertisement MUST update the
Neighbor Cache entry as follows
...
If the Solicited flag is set, the state of the entry MUST be
set to REACHABLE"
This indicates that Target Link-Layer Address option does not need to be
present in the received solicited Neighbor Advertisement to confirm
reachability. Therefore remove `tllao_offset` variable check from the
if condition responsible for updating cache entry. No further changes in
the logic are required because if TLLA option is missing,
`lladdr_changed` will be set to false, so no LL address will be updated.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
According to RFC 4861, ch. 7.3.3:
"Upon entering the PROBE state, a node sends a unicast Neighbor
Solicitation message to the neighbor using the cached link-layer
address."
Zephyr's implementation was not compliant with behavior, as instead of
sending a unicast probe for reachability confirmation, it was sending a
multicast packet instead. This commit fixes it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When Router Advertisement with Source Link-Layer Address option is
received, host should register a new neighbor marked as STALE
(RFC 4861, ch. 6.3.4). This behavior was broken however, because
we always added a new neighbor in INCOMPLETE state before processing
SLLA option. In result, the entry was not updated to the STALE state,
and a redundant Neighbor Solicitation was sent.
Fix this by moving the code responsible for adding neighbor in
INCOMPLETE state after options processing, and only as a fallback
behavior if the SLLA option was not present.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Extends the API for Advertising Coding Selection.
The API is extended to set the Advertising Coding Selection
(Host Support) bit. With this feature, the primary and
secondary PHY can now explicitly report S=2 or S=8 coding
in the extended advertising report. Previously, the report
only indicated LE Coded regardless of whether S=2 or S=8
data coding was used. The API now sets the host support bit
and ensures that the advertising PHY coding scheme is
conveyed to the application via the scan callback.
The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION,
and requires a controller that selects
CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.
Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
If the RTT shell backend is selected and the "down" buffer size
has been selected, the shell bypass functionality should instead
use the buffer size specified by the configuration.
Signed-off-by: Christopher Clingerman <christopher.clingerman@sensorfy.ai>
Add a missing break in supported_context_get, as it was not
intended to fallthrough to BT_AUDIO_DIR_SOURCE or default.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This patch adds support for Zstd and Zip formats to the EDK generation
process. The user can now choose between XZ, Zstd, and Zip compression
and output formats for the EDK file.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Add a new Kconfig option to make the generation of an Extension
Development Kit (EDK) for the LLEXT subsystem optional. This
allows to cleanly separate EDK-related configuration and build
steps from the rest of the Zeprhyr build system.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
In some cases, CPUs that may need to reset or
temporary stop communication. This commit adds "unbound"
functionality that provides a callback to IPC service user
when connection was interrupted for some reason, e.g.
expected or unexpected CPU reset, closing the
endpoint. The "unbound" callback is optional to implement
by endpoints. This commit implements it in the ICMsg
backend.
Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
This condition can happen if there is MDNS activity on the network that is
either not according to specifications or not supported by Zephyr.
Lowering the log level from ERR to DBG, since this does not indicate an
error in the Zephyr application.
Signed-off-by: Helge Juul <helge@fastmail.com>
Do not use memory slabs for the control blocks when
the application provides the memory for it. This
implements manual user-defined allocation memory
management support in CMSIS-RTOSv2 API.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
No functionality change, in preparation for allowing
threads with user provided stack and control block.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
This enables the cmsis wrapper types to be declared
statically and then passed along to CMSIS-RTOSv2 APIs,
enabling static allocation of RTOS control blocks
in the subsequent commits.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
We need to make sure that within Zephyr different users of the PSA APIs
don't interfere with each other because of using the same numerical IDs
for persistent assets.
This takes care of the PSA key IDs when using persistent keys through
the PSA Crypto API.
See the comments in `<zephyr/psa/key_ids.h>` for more information.
This removes the recently-introduced Kconfig options that allowed changing
the base IDs subsystems were using for their persistent keys.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Added new Kconfig option set that allows the user to control the
presence of the following optional characteristics:
- Manufacturer Name String
- Model Number String
Depreacted the old configuration that can be deleted in the future
Zephyr releases.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Fixes an issue when using custom payloads where the size was still
using the zcbor buffer instead of the size of the network buffer
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add APIs to inspect the contents of an ELF file loaded as an extension.
This is useful for applications that need to access the contents of the
extension in a more fine-grained way than the existing LLEXT APIs.
Use of these APIs requires the 'keep_elf_data' option to be provided via
struct llext_load_param to the 'llext_load()' call.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This is required for the functions that inspect the ELF file to work
properly. The user must then call llext_free_inspection_data() before
calling llext_unload() to free the memory left allocated in the loader
and extension memory.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Introduce two new kconfig options in order
to be able to define custom named fatfs
mount points. If activated replace the static
FF_VOLUME_STRS approach with the runtime
generated VolumeStr array containing those
mount points.
Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
Change allows performing ECDH operations through system workq. This is
done to allow reducing memory consumption by disabling the long workq on
small SoCs.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Implement support for DNS Recursive Name option and use obtained
information to configure DNS resolver.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
There's nothing in RFC 2131 or RFC 8415 that would mandate the DHCP
server to reply with a source port set to the IANA assigned one, and
some servers seem to send responses with some arbitrary source port set.
Therefore, make Zephyr's DHCP client implementation more permissive,
accepting packets with a source port set to a different port than the
IANA assigned server port.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>