Gets the specified number of elements from the beginning of the list.
This is the symmetircal operation as `GET_ARGS_LESS_N`.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Returning negative values which are not -1, isn't what POSIX would do and
the API is specifically designed to behave like recvfrom.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
- gw_id is an uint8_t in the protocol, so neither char, nor uint16_t are
the correct type to use.
- addr is an array of bytes, not a string (of characters).
This also corrects related log messages and makes them more consistent, by
using hex for all gw_id's.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
The address is only used for gateway discovery, but using a truncated
`struct sockaddr` can lead to out of bounds reads.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
I don't know, why this was added originally, but there are many issues with
it:
- You can't really return NULL, because src_addr is a `void*`, not a
`void**`. The `src_addr = NULL` didn't do anything.
- The code was checking if the src_addr equals to the broadcast address,
but under normal conditions, that's always a unicast address.
- Even if we would check if the destination address was the bcaddr, I don't
see how that's useful. Currently, the address is only used for messages
of types advertise and gwinfo, which use it to create a new entry in the
gateway list. In that list, you always need the unicast address, never
the broadcast address.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
The `.resource_table` section was not declared anywhere, leading to an
"orphan section" linker warning when OpenAMP was used with the resource
table enabled.
Fix it by adding the missing section to the SoC-specific linker script.
(the section is identical to the one defined for STM32MP1x series)
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on flash usage.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
With the introduction of the board-catalog role in
cd6b1f5c61, using the Zephyr doc
infrastructure without a board catalog instantiated leads to a warning.
Avoid this by disabling the warnings for this role.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add test cases for basic mDNS and DNS-SD queries, making sure the
response contains all IP addresses configured for the interface.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
According to RFC 6763, chapter 12.1, PTR responses SHOULD include
"All address records (type "A" and "AAAA") named in the SRV rdata.".
This was not the case, as only one IPv6 and one IPv4 address was added
in the response by Zephyr. This commit changes this behavior, Zephyr
DNS SD responder will now try to include all IPv4/6 addresses configured
on a given network interface. The current approach of choosing one IPv6
and one IPv4 address first to include in the message is retained - this
is to prevent situation where for example IPv6 addresses will consume
all buffer space, leaving no place for IPv4 ones. The DNS responder will
encode those selected IPv6 and IPv4 addresses first, and then attempt to
include remaining IPv6/4 addresses with "best effort" approach, if there
still is a space in the buffer to add those.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
IPv4/IPv6 source address lookups may return unspecified address in case
there's no valid match (like for example LL address for global
destination). As it makes no sense to include unspecified addresses in
DNS SD replies, verify if that's not the case before adding A/AAAA
record in the response.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Instead of manipulating net_buf's data buffer directly, use net_buf APIs
to reduce complexity when creating mDNS response.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
RFC 6762 Section 6.2 "Responding to Address Queries" specifies that mDNS
responses must include all valid addresses on the interface that is
sending the response. That was not the case for Zephyr's implementation,
which sent only on address in the response (and in some corner cases no
address at all).
This commit fixes this problem. Instead of encoding a single
pre-selected address in the response, mDNS responder will now loop over
all addresses on a given interface, and try to encode them as separate
answer records in the reply.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Cortex-R5F Technical Reference Manual by Arm says DMINLINE is the Log2 of
the minimum number of words (one word = four bytes) in a cache line.
For instance, say DMINLINE is 3, which means the cache line size is
2^3=8 words or 32 bytes, however with the current calculation, it comes
out to be 16 bytes. Therefore, we fix this calculation by correctly
calculating the number of bytes for the cache line size.
Signed-off-by: Amneesh Singh <amneesh@ti.com>
Remove parts of the legacy implementation in eth_stm32_hal_common.c for
the loading of the MAC address when the device-tree is used. Use
net_eth_mac_load() for all these cases that were not destined for
production-ready products.
When cfg->mac_cfg.type == NET_ETH_MAC_DEFAULT, it means that neither
"zephyr,random-mac-address", "local-mac-address" or "nvmem-cells" were
used. For this case, keep the legacy property-less implementation to
avoid compilation errors and have a default, backward-compatible case.
Warning: this commit causes backward compatibility breakage for
implementations using "zephyr,random-mac-address" or "local-mac-address"
properties.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Adds support for using MCUmgr over UART (not via shell) in a raw
mode which does not include base64 and other SMP over console
encoding
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Follow-up to PR# 102385.
Some occurrences of ${BOARD}${BOARD_QUALIFIERS} was missed in the
original alignment PR.
This commit adjusts the remaining occurrences to know include `/`.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The nrf54l15 SoC is already present and tested through the
nrf54l15dk. Exclude from sample to save CI time.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The nrf PINCTRL test suite does not enable PINCTRL. This has worked
until now since the UART driver used for the console typically is
enabled by default, selecting PINCTRL. This is not the case always
however, and the test suite does not require any "real" device being
enabled to test pinctrl.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Introduce the nrf54l15tag board which is a hardware platform for
designing and developing applications with the nrf54l15 soc.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Remove the hard-coded target knowledge of menuconfig, hardenconfig, and
guiconfig and instead use the ZEPHYR_SHARED_TARGETS provided by the
Zephyr image.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Use zephyr_custom_target_shared for menuconfig and friends so that
knowledge about those targets are available in through the CMake cache.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The function zephyr_custom_command_shared extends the CMake
add_custom_command.
Sysbuild maps custom image build targets, such as `menuconfig` to
top-level `<image>_menuconfig`, however this knowledge is built into
sysbuild. Providing `zephyr_custom_command_shared` allows an image build
target to be shared with sysbuild and other external tools to share
information about important build targets available in the image.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
CMake cache persists between CMake runs.
The CMake cache both ensures a setting keeps its value between CMake
re-runs but the CMake cache is also used by external tools, such as
sysbuild and west, to read information about the build system.
The CMake cache has a limitation when handling lists. It's easy to
extend a CMake cache list with extra values, but it's difficult to clear
the list to ensure only values from current CMake run is present in the
list, because cached lists are always initialized with the value from
previous run.
This commit extends `zephyr_set()` with a cache scope.
The cache scope is empty initialized for a given CMake run.
Any write to the CMake scope is mapped into the CMake cache, and thus
the value is shared to external tools.
This removes the CMake cache limitation for list handling.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Update the HW models module to:
cf40f6dc7fc441ee6848ea2e177c4522588c1b8c
Including the following:
cf40f6d TIMER: Fix bug with trigger in less than 1us
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
If we get DHCPv4 bound event, then resend mDNS announce message
for that interface. This way a new address from DHCP server will
get announced properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>