Add word 'by' to function names to clarify which is the thing that
is found and which is the thing that is searched for. For example,
mqtt_sn_topic_find_name was renamed to mqtt_sn_topic_find_by_name
because the function does not find the name but finds a topic by
its name.
Signed-off-by: Rene Beckmann <rene.bckmnn@gmail.com>
When HTTP 101 Switching Protocols response is received, force the HTTP
parser to ignore any potential message body payload (which should
already belong to the new protocol).
This is usually not an issue, as Switching Protocols reply should
contain headers only, however it's been observed that some servers
specify chunked transfer-encoding header which tricks the parser
to wait for payload event though it never arrives.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When building relocatable extensions, exported symbol names might end
up in a separate section (in my case ".rodata.str1.1") for which
storage address don't match section address. To access those names
addresses have to be relalculated.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Building bluetooth.shell.audio.only_gtbs with clang warns:
subsys/bluetooth/audio/tbs.c:1646:6: error: variable 'ret' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
if (param->gtbs) {
^~~~~~~~~~~
subsys/bluetooth/audio/tbs.c:1667:9: note: uninitialized use occurs here
return ret;
^~~
subsys/bluetooth/audio/tbs.c:1646:2: note: remove the 'if' if its
condition is always true
if (param->gtbs) {
^~~~~~~~~~~~~~~~~
subsys/bluetooth/audio/tbs.c:1626:9: note: initialize the variable 'ret'
to silence this warning
int ret;
^
= 0
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
We have previously fixed an issue with shifting and
assigning the value without a cast, but coverity
is still complaining about aa[1] and aa[0] with:
"Casting narrower unsigned aa[1] to wider signed type
int effectively tests its lower bound."
Using the common function, sys_get_le24, should fix this issue.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Explicitly cast Kconfig option value to avoid truncation issue reported
by Coverity.
Fixes#84697
Coverity-CID: 487737
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit checks that ATT MTU value returned by `bt_gatt_get_mtu` is
greater or equal to 3 to prevent integer overflow.
Fixes#84693
Coverity-CID: 487743
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Ensure that ~(link.rx.seg) & SEG_NVAL doesn't result in 0.
Fixes#84804
Coverity-CID: 393090
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Fixed the following issues:
1) Missing guard before accessing parameters
2) Fixed bad sizeof when resetting
3) Fixed several bad offsets when removing attributes
Added tests to verify that it works now.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds a new Kconfig for selecting swap using move in MCUboot which
aligns with the proper MCUboot symbol and allows for adding
additional mode Kconfigs
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
When we receive a response from a server we do not have an
outstanding request with, we disconnect the connection
rather than just ignoring it.
The reason for this is that the remote server is
not ensuring correct ATT flow control, which means
that we cannot trust future responses from the
server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
psa_crypto_init was bounded to CONFIG_BT_HOST_CRYPTO_PRNG and
used to be called under prng_init. Updating the ifdef condition
and appropriating the function name for crypto init.
Also it is better to make sure psa_crypto_init called by host.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
This fixes out of scope IRQ lock key by using SEGGER_RTT_Write
version that locks the IRQ by itself.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Print interface status information for "net iface" command.
This is useful information when debugging connectivity issues.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The server uses host support to export a USB device to a remote
USBIP client. It supports control and bulk transfers, interrupt
transfers may also work, but this depends on the host controller used.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Allow dynamic allocation of USB devices on connected event.
Add very basic USB device validation and configuration.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Handle them in separate contexts so that the request completion callback
cannot be blocked, such as when a device connection is detected and
requires configuration.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The transfers require enpoint MPS for proper transaction handling,
assign it in the common place during transfer allsocation so that it can
be reused.
Some users, such as USBIP, may need to keep a reference to private data,
add a parameter for completion callback data.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add an opaque pointer to store upper layer private data and initialize
it with the USB host context during controller initialization. Use the
pointer in event processing to get the correct context.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Address parameter/argument is no longer needed because we have a pointer
to the USB device. The Attrib parameter has never been used and will be
replaced by the interval and start-frame parameters in the future.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This will allow the controller driver to access information about the
device in the future.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Implement the dequeue function and remove the timeout parameter as it is
no longer necessary and can be handled in the upper layer. The dequeue
function is required for the USBIP implementation.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add the check if dev is NULL (when iface is NULL, dev is NULL) when
setting Wi-Fi CMD, in case Wi-Fi driver init fails and shell crashes.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Setting Wi-Fi cmd only when the net interface is up, avoid the case
that driver deinit and net interface is down, then the L2 APIs interact
with supplicant and driver, which may lead to CPU exception.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Add check that the command buffer claimed in `bt_le_create_conn_cancel`
is not `NULL`. Fixes a fault caused by providing the `NULL` buffer to
`bt_hci_cmd_state_set_init`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Building with clang warns:
subsys/net/ip/utils.c:600:24: error: unused function 'pkt_calc_chksum'
[-Werror,-Wunused-function]
static inline uint16_t pkt_calc_chksum(struct net_pkt *pkt, uint16_t sum)
^
pkt_calc_chksum is called by net_calc_chksum, which only exists when
CONFIG_NET_NATIVE_IP is defined.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Adds API for Advertising Coding Selection.
Introduces two new advertising options to configure the advertiser's
requirement concerning coding scheme when LE Coded PHY is configured.
While the Bluetooth v6.0 specification makes a distinction betweeen
preferred and required advertising PHY options, a simplification is
made to only expose the required PHY options. Inline with how LE Coded
PHY is implemented; this API will set both the primary and secondary
advertising PHY's to the same coding scheme.
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>
Building sample.bluetooth.tmap_central with clang warns:
subsys/bluetooth/host/iso.c:2194:6: error: variable 'rsp' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
if (!advanced) {
^~~~~~~~~
subsys/bluetooth/host/iso.c:2202:6: note: uninitialized use occurs here
if (rsp == NULL) {
^~~
subsys/bluetooth/host/iso.c:2194:2: note: remove the 'if' if its
condition is always true
if (!advanced) {
^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2137:21: note: initialize the variable 'rsp'
to silence this warning
struct net_buf *rsp;
^
= NULL
subsys/bluetooth/host/iso.c:2295:6: error: variable 'rsp' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
if (!advanced) {
^~~~~~~~~
subsys/bluetooth/host/iso.c:2303:6: note: uninitialized use occurs here
if (rsp == NULL) {
^~~
subsys/bluetooth/host/iso.c:2295:2: note: remove the 'if' if its
condition is always true
if (!advanced) {
^~~~~~~~~~~~~~~
subsys/bluetooth/host/iso.c:2258:21: note: initialize the variable 'rsp'
to silence this warning
struct net_buf *rsp;
^
= NULL
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
The function may return a BT_GATT_ERR which is a negative
value that cannot be returned as uint8_t. Change the function
to use int instead and document the return values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The encryption functions should document the expect byte order of
inputs and the byte order of the outputs.
The sef and sdf functions were also using an older, and incorrect,
description of the input, as it only takes the LTK as per CSIP 1.0.0
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When PM_POLICY_DEVICE_CONSTRAINTS is enabled, we create a list of
devices with the property “zephyr,disabling-power-states” and their
respective states to lock. However, if a device is declared but not
built (e.g., due to a Kconfig option), we have an undefined reference.
This PR changes the code to use the device name instead of the
reference. This increases lookup time (which could be cached at
runtime), and we still have an entry for a non-existent device.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
It might happen now after the commit 8519fa1627 ("net: socket service
resets its restart flag") that the event has disappeared before we
call the work, if that happens we must not bail out but restart
the service.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Just ignore any EALREADY error returned when trying to register a
DNS dispatcher. This could happen if trying to init things when the
interface comes up and we have already initialized the dispatcher.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The DNS_EAI_SYSTEM error value tells that the errno value
contains the actual system error value. So set the errno
properly when there is a system error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Feed the dispatcher context to dispatcher callbacks instead of
resolver or responder context. The callback can then use the
proper context because the dispatcher context contains those
two context. This allows dispatcher callback to utilize all the
information (like interface etc) stored in dispatcher context.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
As the zsock_recv_dgram() is rather large, remove the inline
keyword from it and let compiler to decide what to do with it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print the socket descriptor and interface after bounding it
successfully in order to help to figure out what sockets are
bind to one specific interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Restore only the socket descriptor that we marked as -1 after running
the work related to that socket. Earlier we tried to restore the whole
global array of descriptors which could go wrong and is not needed
as we only support synchronous work.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>