When calling net_if_get_default(), print a warning if no
network interfaces are found. This helps debugging mysterious
crashes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When trying to get IPv6 prefix, if there are no network interfaces
then the net_if_get_default() will return NULL but we should not
crash at that point but return gracefully.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
There needs to be at least one network interface in order
to avoid this error.
E: There is no network interface to work with!
So enable loopback support which creates a loopback interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Making default preferred time much closer to default valid time
so that the served addresses are much shorter time in deprecated
state where they cannot be utilized. This is important in Zephyr
as there are limited number of IPv6 addresses that can be allocated
to the network interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The local address used for established TCP socket needs to be
dig out from TCP internals and not from context->local.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
We usually cannot use context->local for established TCP connections
because the local address is not updated for TCP if we are bound to
any address. So create helper that try to figure out the end point
addresses.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Do not print progress report so that makes debugging things
a lot harder. It is still possible to enable printouts if needed
by setting PRINT_PROGRESS symbol.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If the IPv6 address that our socket is bound to deprecates, then
re-create the socket so that we avoid using deprecated IPv6 address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure the IPv6 source address selection works as expected
when using the IPV6_ADDR_PREFERENCES socket option.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for IPv6 Source Address Selection defined in RFC 5014.
This commit does not add any address selection support to getaddrinfo()
as described in the RFC. The AI_EXTFLAGS symbol and also the ai_eflags
to hints is added but they are not used by the code.
The public/temporary address selection is only done internally by
the net_if_ipv6_select_src_addr_hint() according to flags set by
setsockopt().
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When printing IPv4 and IPv6 address information in "net ipv4" and
"net ipv6" commands, print also reference count of the IP address.
This is useful for debugging purposes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add reference counting to network interface address (for both
IPv4 and IPv6) so that the address is not removed if there are
sockets using it. If the interface address is removed while there
are sockets using it, the connectivity will fail for the said
socket.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add events to be generated when privacy extension is enabled
or disabled, or when allow/deny filter is added or deleted.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When executing "net iface" command, print current status of
IPv6 privacy extension if it is enabled in config file.
The "net ipv6 ..." command prints IPv6 privacy extension
information, and can add or delete IPv6 prefix filters.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If IPv6 privacy extension is enabled, then we need to select
proper public or temporary IPv6 source address when sending the
packet.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This creates support for IPv6 privacy extensions which is described
in RFC 8981. This will also add API that can be used to add IPv6
prefixes to a allow or deny list privacy extension filter.
The code will create temporary IPv6 addresses from prefixes that
are advertised by Router Advertisement messages. The temporary
IPv6 addresses are then expired according to lifetime and removed.
Fixes#9349
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If IPv6 address expires and moves to deprecated state, then
send a mgmt event so that listeners can act on it.
One such action is to close a socket bound to that source address
so that the address can be released.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit introduces a new test case for veryfing that addition and
deletion of multicast routing entries emit MLDv2 reports when needed
and if multicast routing entries are appended to MLDv2 records properly.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
This commit adds transmission of MLDv2 reports whenever a multicast
routing entry is added or removed when suitable (it checks if the
given interface itself has joined the group).
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
This commit introduces a new option CONFIG_NET_MCAST_ROUTE_MLD_REPORTS
which appends multiacst routes to MLDv2 reports. These records are
intended to inform reports' recipients about potential listeners on
the other interfaces.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
Disable this explicitly as done for other boards using a USB console by
default, prevents a build warning:
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit should add all the functionality needed for the MIPI DBI
driver to work when PM is enabled.
Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
Add support for VPR CLIC to `nested_irq` kernel test.
Verified on nRF54L15 FLPR for now.
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
`CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET` offsets IRQ in
vector table, align test to this functionality.
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
Set RNG address to its non-secure alias.
See RM0493 STM32WBA5 Reference manual for details.
Using the secure alias (0x5..)instead of the non-secure alias (0x4..)
for this peripheral results in a SecureFault during kernel init if
TrustZone is activated, Zephyr is running as NSPE and RNG is
enabled.
Signed-off-by: Louis Feller <louis.feller@st.com>
This aligns abort() and exit() definitions with other libc.
Without 'noreturn' attribute, compilers have to assume that we will
return from these functions which can lead to surprising errors like
'error: non-void function does not return a value'.
Signed-off-by: Patryk Duda <patrykd@google.com>
The coap_client lib only handled "one-shot" requests properly. This
patch allows it to keep listening for additional responses to a request,
if the request was made with the CoAP OBSERVE option appended.
An API for canceling such requests is also added.
Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
The size field in net_buf should not be used directly as then
the optional headroom will not be taken into account.
There is the net_buf_max_len() API that should be used instead.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
One should not call a function directly from within zassert()
as it can cause the value of errno to be lost as seen by this
failed test output
Assertion failed at tests/net/socket/reuseaddr_reuseport/src/main.c:151:
test_bind_success: (zsock_bind(sock, addr, addrlen) not equal to 0)
bind() failed with error 0
FAIL - test_ipv4_udp_bad_both_not_set in 0.000 seconds
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When there is no implementation for a particular hardware information
device, the API return -ENOSYS, while the hardware information shell
checks for -ENOTSUP. This returns a non-user friendly message:
uart:~$ hwinfo devid
Error: -88
The API can't be changed easily without breaking things, so let's change
the shell instead. This gives:
uart:~$ hwinfo devid
Not supported by hardware
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
When calling bap_broadcast_assistant add_pa_sync, it should only
set the BIS index field as optional parameters and not to whatever
is in the BASE.
If setting BIS index which the BASE does not support, then the
command should be rejected.
This PR fixes https://github.com/zephyrproject-rtos/zephyr/issues/70835
Signed-off-by: Ping Wang <pinw@demant.com>
When calling bap_broadcast_assistant add_pa_sync, it should only
set the BIS index field as optional parameters and not to whatever
is in the BASE.
If setting BIS index which the BASE does not support, then the
command should be rejected.
This PR fixes https://github.com/zephyrproject-rtos/zephyr/issues/70835
Signed-off-by: Ping Wang <pinw@demant.com>
The commit adds support for LESC in the host if the controller
does not support the public key generation for ECDH.
Signed-off-by: Ping Wang <pinw@demant.com>
When SSP is consumer for FS and BCLK then it does not needs MCLK as the
shifting and rate is derived form the I2S bus directly.
When SSP provides FS only then the BCLK setup is not needed.
When SSP provides BCLK only then both MCLK and BCLK setup is needed.
In hardware multiple SSPs share the same MCLK source, in case of one
SSP port is used as clock provider while other is used as clock consumer
then the consumer SSP should not need to depend on the provider SSP
configuration, the ports can run in different clock rates.
In this example the consumer SSP should not try to configure and lock the
MCLK frequency to some arbitrary rate (as it does not need MCLK at all)
which might be different than the frequency needed by the provider port.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
QEMU 9.0 removes the `-no-acpi` option, which breaks emulation on x86
platforms when CONFIG_ACPI is not set. See:
https://github.com/zephyrproject-rtos/zephyr/issues/72191
This PR replaces `-no-acpi` with `-machine acpi=off`, as specified by
the QEMU documentation. It works on QEMU 8, but not been tested on
earlier versions.
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
Add support for the MSI clock on the STM32WL family. This is needed for
instance to set the RNG clock domain to MSI in the device tree when not
using the PLL.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Commit 246ea739bb ("dts/arm/st: wl: increase Sub-GHz SPI frequency to
12MHz") increased the Sub-GHz to 12 MHz. This matches the SX126x
datasheet, but there is no information about the maximum speed in the
STM32WL datasheet or reference.
This works fine when not using DMA. However with DMA activated (adding
entries to the device-tree and enabling CONFIG_SPI_STM32_DMA), I have
encountered some rare corruption. When it happens, the read from the
Sub-GHz device gets an extra 0x00 byte prepended, which confuses the
LoRaMac-node library and causes reception failures. Decreasing the
frequency to the next round number, that is 8 MHz (i.e. increasing the
prescaler from 4 to 6) fixes all the issues I encountered.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>