Commit graph

24,075 commits

Author SHA1 Message Date
Flavio Ceolin
f4a423c985 net: http_server: Normalize URL path before lookup
Add http_server_normalize_url() to resolve '.' and '..' segments in
client->url_buffer once the URL is fully assembled to avoid a remote
client to read files outside the configured web root.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-05-08 08:05:36 +02:00
Fin Maaß
74bd4fc64d qemu: net: ethernet: enable NET_L2_ETHERNET
when using NET_QEMU_ETHERNET or NET_QEMU_USER
enable NET_L2_ETHERNET by default, as
in this mode we need the ethernet drivers.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-07 18:10:17 -05:00
Fin Maaß
c35daeb60b net: qemu: add NET_QEMU_* dt dependency
make sure we don't use slip or ppp, if we don't
have the right chosen set in the devicetree.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-07 18:10:17 -05:00
Egill Sigurdur
16ac4a5b78 kernel: mem_slab: add K_MEM_SLAB_DEFINE_TYPE for automatic alignment
Introduces K_MEM_SLAB_DEFINE_TYPE() and K_MEM_SLAB_DEFINE_STATIC_TYPE()
helpers to allow the user to declare slabs for types without having to
manually ensure the alignment is correct.

Manual slab alignment was very error-prone and this change fixes several
instances of misalignment that would be trapped by the undefined
behavior sanitizer when running on 64-bit targets.

Signed-off-by: Egill Sigurdur <egill@egill.xyz>
2026-05-07 18:09:41 -05:00
Zhaoxiang Jin
89506681f7 cpu_freq: enable thermal_cap for cpu_freq subsystem
enable thermal_cap for cpu_freq subsystem, which allows
CPU frequency to be reduced when the die temperature
exceeds certain thresholds.

This is useful for preventing overheating and maintaining
system stability under high load or in high ambient
temperatures.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-05-07 18:07:33 -05:00
Jonas R. Hansen
db2d9162b7 usb: usbip: make USBIP service port configurable
Makes it possible to host multiple native_sim's with native networking
without port collisions

Signed-off-by: Jonas R. Hansen <jonas.jmh@gmail.com>
2026-05-07 15:11:38 +01:00
Tomasz Chyrowicz
ce334a9c9f mgmt: img_mgmt: Add a transport-specific req
Add a dependency on the NETBUF size if the UART transport and the
img_mgmt group is selected.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2026-05-07 13:19:00 +01:00
T Madhusudhan Rao
3ccd07b202 net: ptp: fix time domain mismatch in foreign clock cleanup
The foreign clock cleanup logic was incorrectly comparing the PTP
hardware timestamp against the local k_uptime_get(), resulting in
erroneous packet aging.

This introduces a 'local_uptime_ms' field to track the actual local
arrival time of ANNOUNCE messages, isolating the aging logic
from the PTP hardware clock domain.

Fixes #108479

Signed-off-by: T Madhusudhan Rao <tetakalam@aerlync.com>
2026-05-07 10:46:31 +01:00
Jukka Rissanen
5d571ee0d5 net: quic: Initialize default key exchange group
This will avoid this error message

   Unknown group 0x0000, defaulting to secp256r1

when generating ECDH keypair.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-07 10:46:04 +01:00
Muhammad Waleed Badar
c637f2a0da net: shell: http: add options to HTTP client shell commands
Add getopt-based argument parsing to HTTP client shell commands
supporting options:

  -d, --data     <data>     HTTP POST data
  -H, --header   <header>   Custom HTTP header
  -p, --proto    <protocol> HTTP protocol version
  -E, --cert     <tag>      TLS credential tag
  -t, --timeout  <seconds>  Set connection timeout in seconds
  -k, --insecure            Disable SSL certificate verification
  -v, --verbose             Make the operation more talkative

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-05-07 10:45:57 +01:00
Tomi Fontanilles
7d65b380e2 modules: mbedtls: link to mbedTLS only when CONFIG_MBEDTLS_BUILTIN
393350fd65 made it so that the `mbedTLS`
library is only created when `CONFIG_MBEDTLS_BUILTIN`.

Before this commit, users of Mbed TLS did the following:
`zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)`

If the `mbedTLS` CMake library doesn't exist but is still linked to
(as is the case when `CONFIG_MBEDTLS && !CONFIG_MBEDTLS_BUILTIN`),
the linker command is populated with `-lmbedTLS` which makes the build
fail because there is no `libmbedTLS.a` in the build.

Make it so that users of Mbed TLS only link to the `mbedTLS` CMake
library when the builtin version is used.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2026-05-07 09:11:36 +02:00
Jukka Rissanen
d822c93967 net: shell: quic: Enhance the statistics prints
Show also past Quic statistics.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-06 19:58:42 +02:00
Jukka Rissanen
d0d44c31d2 net: quic: Add more statistics collection
Collect statistics in various stages of the Quic connection.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-06 19:58:42 +02:00
Håvard Reierstad
4feab28245 Bluetooth: Host: Change default BT_BUF_EVT_DISCARDABLE_SIZE
With adding discard-tracking of extended advertising reports, the
reports are allocated from the discardable event pool instead of the
"normal" event pool. This commit sets the default value of
BT_BUF_EVT_DISCARDABLE_SIZE to BT_BUF_EVT_RX_SIZE when BT_EXT_ADV
is enabled.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-05-06 16:29:15 +01:00
Håvard Reierstad
e3a3a8e685 Bluetooth: Host: add fragmented ext adv stress test
Extends the `host/scan/slow` bsim test to test that the reassembler
is able to recover from a discarded extended advertising report chain.

This requires tracking that extended advertising reports are in fact
received, and that the reassembler times out. Functions for this are
added to testing.h which is only compiled if BT_TESTING is enabled.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-05-06 16:29:15 +01:00
Håvard Reierstad
41e3b91fcb Bluetooth: HCI: Allow discarding of ext adv reports
Implements a method for discarding fragmented extended advertising. In
order to acheive this, we need to consider past and future fragments
of the advertising report we discard.

The future fragments are on its way from the controller, and will result
in either a complete- or incomplete event. These are handled by tracking
the adv SID and address until the controller sends either a complete or
incomplete event. Once an advertising report is marked as discarded,
consecutive fragments will be silently discarded.

The past fragments are either already in the reassembler (in scan.c),
or on their way through the rx_queue. To handle these, and allow the
reassembler to recover from a in-progress reassembly which is discarded,
we add a work item which is rescheduled when each consecutive fragment
is received. The timeout is configurable through the new Kconfig option
`CONFIG_BT_EXT_ADV_REASSEMBLY_TIMEOUT`. On timeout, the reassembler will
change its state to discard incoming fragments from the same advertiser.
The reassembler will start assembling new fragments if it recognises a
new advertiser, or if a final fragment (either marked as complete
or incomplete) from the advertiser it is currently tracking is received.

This functionality needs to be added at a HCI driver level by using the
new `hci_ext_adv_report_process` function. It is added the the
IPC HCI driver to fix zephyrproject-rtos/zephyr#50786

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-05-06 16:29:15 +01:00
Cristian Bulacu
553e505e6b openthread: border_router: Remove IPV6 packet checksum when forwarding
In case of using ethernet as backbone interface, some NICs may want to
have checksum set to 0 for a correct computation.
This commit aims to address this issue by checking if hardware has
offload capabilities and setting IPV6 packet checksums to 0, if needed.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2026-05-06 16:26:53 +01:00
Tim Pambor
d3c24cfadb crc: fix sometimes uninitialized warning
flag_reversed in crc8() is only initialized if reversed is true.
Set flag_reversed to 0 if reversed is false.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-05-06 09:57:45 +01:00
Emil Gydesen
7cb64ce38b Bluetooth: TBS: Fix out-of-bounds read in bt_tbs_valid_uri
The for loop could have read uri[uri_len] due to the i + 1.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-05-06 09:57:31 +01:00
Malliga Moorthi
20a5183186 net: vlan: fix incorrect virtual interface listing as vlan interface
When Kconfig option CONFIG_NET_CAPTURE=y is used and VLAN feature
is enabled and tested, this Kconfig creates two virtual interfaces,
IP_TUNNEL0 and NET_CAPTURE0. On "net iface" shell command, when
interfaces get listed, the IP_TUNNEL0 virtual interface for
packet capture/debug purpose, gets listed as vlan interface, which
is incorrect. On testing, before this fix, IP_TUNNEL0 interface gets
listed as vlan0, after fix it shows as net0 instead.
This fix needs to be backported to zephyr 4.4.

Signed-off-by: Malliga Moorthi <malliga.moorthi@nokia.com>
2026-05-06 09:57:24 +01:00
Yangbo Lu
19d5ca1c68 net: config: support config init for interface already manually up
Current code was preventing all NET_IF_NO_AUTO_START interfaces for
config init.

This patch is to change that and to prevent only NET_IF_NO_AUTO_START
interfaces with link down status.

Then interfaces already manually up, like bridge can be supported.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-05-06 09:56:48 +01:00
Yangbo Lu
0942d5d4a7 net: ethernet: bridge: handle gPTP frame via gPTP bridge stack
gPTP frame should be handled via gPTP bridge stack. So, do not
forward them or handle them by bridge interface.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-05-06 09:56:48 +01:00
Yangbo Lu
f3a24fca45 net: ethernet: gptp: use debug level message for resetting pdelay request
It's normal there is no gPTP device connected. We didn't have to use
warn level message for resetting pdelay request. Change to use debug
message which can avoid endless noise messages.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-05-06 09:56:48 +01:00
Yangbo Lu
43e2eed6e9 net: ethernet: improve Qbv Kconfig dependency
Qbv uses management interface, so just select NET_L2_ETHERNET_MGMT.
Qbv time is based on PTP clock. When enable Qbv shell, just select
PTP clock shell too because at least we need to check base time
via PTP clock shell.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-05-06 09:56:48 +01:00
Egill Sigurdur
448a21da12 net: dns: fix string read out of bounds
Fix issue that would be trapped by the address sanitizer, would always
read 7 bytes even though ptr might be shorter, and would therefore
read out of bounds if e.g. the string ".org" was passed.

Signed-off-by: Egill Sigurdur <egill@egill.xyz>
2026-05-06 07:09:41 +02:00
Tim Pambor
4127e0c97d net: zperf: udp uploader: Include FIN packet in packet count
The FIN packet was not counted in the number of packets sent.
This behavior differs from iperf2, which counts the FIN packet
as well. Previously, the statistics reported by iperf2 were
off by one compared to zperf, which was confusing.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-05-06 07:07:04 +02:00
Tim Pambor
0380604454 net: zperf: udp uploader: start packet IDs at one
In iperf2, the first packet of a session has ID 1.
Change the UDP uploader to start packet IDs at one,
so that the behavior is the same as iperf2.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-05-06 07:07:04 +02:00
Tim Pambor
cb2324d3e2 net: zperf: udp receiver: include final packet in statistics
In Zperf UDP receiver mode, the final packet of a session
was not included in the session statistics, which caused the
results to differ from those reported by iperf2.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-05-06 07:07:04 +02:00
Tim Pambor
92f59f5f6d net: lib: zperf: fix incorrectly reported lost packet
In Zperf UDP receiver mode, the first packet of a new session
was always counted as lost due to only initiating a new session
but not processing the packet as part of the new session.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-05-06 07:07:04 +02:00
Christoph Busold
88278fb59f drivers: entropy + random: Add implementations for ARM64 RNG
Add new implementations for entropy driver and random subsystem
based on ARM64 RNDRRS and RNDR instructions.

Signed-off-by: Christoph Busold <cbusold@qti.qualcomm.com>
2026-05-06 07:05:12 +02:00
Christoph Busold
dad5096f85 drivers: entropy: Add support for architectural entropy drivers
Add new inline function entropy_get_default_device which returns
the "zephyr,entropy" device or the architectural entropy device,
if the former is not set, and use that in all places to query the
entropy device.

This allows using architectural drivers which do not have a DT
node.

Signed-off-by: Christoph Busold <cbusold@qti.qualcomm.com>
2026-05-06 07:05:12 +02:00
Mikolaj Klikowicz
8afa8f1b5a tracing: ctf: use 64-bit timestamps
Changes CTF events to use 64bit timestamp. This enables tracing of
longer
execution as 32bit timestamps overflows after ~4s.

Signed-off-by: Mikolaj Klikowicz <mklikowicz@antmicro.com>
2026-05-05 14:07:47 -05:00
Cristian Bulacu
07fc65330d net: dns: Add support for DNS private RR types
This PR implements support for DNS Private Resource Records (RR)
as defined in RFC 6895, enabling applications to query and
handle DNS records in the private use range (type codes 65280-65534).
This feature is not enabled by default,
CONFIG_DNS_RESOLVER_PRIVATE_RR_SUPPORT is used to enable it.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2026-05-05 14:06:23 -05:00
Rithic Chellaram Hariharan
6b71a4dce3 net: http: client: fix timeout rounding
Use k_ticks_to_ms_ceil32 instead of k_ticks_to_ms_floor32 to prevent
premature zero-ms timeouts when remaining ticks round down to zero.

Signed-off-by: Rithic Chellaram Hariharan <gr8rithic@gmail.com>
2026-05-05 14:05:55 -05:00
Rithic Chellaram Hariharan
bceb910286 net: http: client: make send buffer size configurable via Kconfig
Replace hard-coded MAX_SEND_BUF_LEN (192) with a new Kconfig option
CONFIG_HTTP_CLIENT_SEND_BUF_SIZE so applications can tune the
stack-allocated send buffer size based on their memory constraints.

Signed-off-by: Rithic Chellaram Hariharan <gr8rithic@gmail.com>
2026-05-05 14:05:55 -05:00
Jamie McCrae
a64883ef5d mgmt: mcumgr: grp: os_mgmt: Fix MPSTAT invalid map
Fixes wrongly having an extra map entry for this response

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-05-05 14:05:44 -05:00
Emil Gydesen
382e2efd33 Bluetooth: BAP: Shell: rm unused right_ring_buf_fail_cnt
The right_ring_buf_fail_cnt field was never read.
Remove the dead field.

Assisted-by: Claude:claude-sonnet-4.6

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-05-05 16:03:42 +01:00
Emil Gydesen
8fc67e6e31 Bluetooth: Audio: add ARG_UNUSED to unused function parameters
Apply ARG_UNUSED() to unused function arguments as per the Zephyr
coding guidelines

A few functions were modified to remove unused parameters
or to actually use the parameters.

Assisted-by: GitHub Copilot

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-05-04 22:08:33 +02:00
Fin Maaß
22947e1019 usb: host: shell: fix level of printed messages
fix level of printed messages.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-05-04 22:08:01 +02:00
Emil Gydesen
44c50815e6 Bluetooth: MCC: Shell remove unused MCC track segments cache
Remove unused field

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-05-04 22:07:39 +02:00
Emil Gydesen
f1d872ebf4 Bluetooth: BAP: BA: remove unused scanning field
The scanning field was set to false in broadcast_assistant_reset() but
never read anywhere. The scanning state is tracked via the
BAP_BA_FLAG_SCANNING atomic bit; the bool field is leftover dead code.

Assisted-by: Claude:claude-sonnet-4.6

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-05-04 22:07:31 +02:00
Bhavin Umatiya
29cbe1d5b8 Bluetooth: Controller: Introduce timer tick conversion define
Introduce HAL_EVENT_TIMER_US_TO_TICKS macro to explicitly map the 1 MHz
hardware timer resolution to the radio configuration, preventing unintended
unit mixing between microseconds and hardware ticks.

Fixes #105085

Signed-off-by: Bhavin Umatiya <umatiyabhavin@gmail.com>
2026-05-04 21:55:03 +02:00
Jukka Rissanen
7d0ba33997 net: shell: dns: The list sub-command was giving wrong advice
User must enable CONFIG_DNS_SD option to enable the "list"
sub-command for the "dns" command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 15:03:30 +02:00
Jukka Rissanen
57ce922032 shell: Check return code from api read()
Make sure to check the return code from sh->iface->api->read()
and bail out if there is an error. The issue was noticed in ssh
client testing where the ssh shell was terminated which then caused
a forever loop.

Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 15:00:15 +02:00
Emil Gydesen
2b7eaa153b Bluetooth: BAP: remove unused broadcast_sink from bt_bap_ep
The broadcast_sink pointer was written in three places (set and
cleared) in bap_broadcast_sink.c but never read or dereferenced
anywhere in the codebase. Remove the field, its three write sites,
and the now-unneeded forward declaration of struct bt_bap_broadcast_sink
in bap_endpoint.h.

Assisted-by: Claude:claude-sonnet-4.6

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-05-04 14:59:29 +02:00
Jukka Rissanen
81f336adac net: quic: Move PSA key import into private key setup
Refactor the QUIC TLS credential path so private-key parsing and PSA
signing-key import happen in tls_set_private_key().

The previous flow parsed the certificate in tls_add_own_cert(), parsed
the private key in tls_set_private_key(), and then called
quic_tls_set_own_cert() later from init and credential refresh paths
even though that helper no longer installed the certificate. Its real
work was importing the private key into PSA, which made the control
flow harder to follow and duplicated private-key parsing.

Move the signing-key import into tls_set_private_key(), remove the
misleading follow-up quic_tls_set_own_cert() calls, and drop the now
unused raw-key bookkeeping from the TLS context. This keeps
certificate handling in the certificate loader and private-key
handling in the private-key loader while preserving the existing
handshake behavior.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 14:57:59 +02:00
Jukka Rissanen
06dcd3e48a net: quic: Clarify STREAM protocol-error handling
Add a dedicated STREAM frame error helper and use it at both STREAM
dispatch sites in quic_packet.c.

STREAM handling already uses -EPROTO to mean that a specific transport
close was attempted by the lower-level handler, for example on stream
limit or receive-side flow-control violations. The previous open-coded
special case worked, but it left that contract implicit and routed the
other STREAM errors differently from the rest of the frame handlers.

Make the contract explicit in one helper: keep -EPROTO as the
close-already-sent path for STREAM, and continue mapping malformed
STREAM frames through the generic frame-encoding error handling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 14:57:59 +02:00
Jukka Rissanen
3d63d37eb0 net: quic: Harden anti-amplification budget check
Avoid adding the requested send size directly to the tracked
anti-amplification TX count when checking whether an unvalidated
server endpoint may transmit.

The tracked counters are small in practice, but the helper accepts a
size_t byte count and the previous uint64_t addition could wrap for a
very large input on 64-bit builds. Rework the check to compare the
requested size against the remaining budget instead.

Add regression coverage that passes SIZE_MAX to the helper and
verifies the request is rejected rather than wrapping into an allowed
send.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 14:57:59 +02:00
Jukka Rissanen
8b1adba5a4 net: quic: Skip close on synthetic rx endpoints
Guard the flow-control error close paths in quic_stream_receive_data()
so they only send CONNECTION_CLOSE for socket-backed endpoints.

The Quic unit tests exercise receive-side flow-control handling with
synthetic endpoints that set sock = -1 and do not initialize recovery
state. Sending CONNECTION_CLOSE from those paths can reach recovery
shutdown and touch an uninitialized lock even though no transport
packet can be sent.

Keep returning -EPROTO for the protocol violation, but skip the close
when the endpoint is not fully usable for transport I/O. Add coverage
for the RX buffer overflow path and assert that synthetic endpoints do
not enter recovery shutdown on these fatal receive errors.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 14:57:59 +02:00
Jukka Rissanen
d9698f5143 net: quic: Handle version checks before Initial validation
Process Version Negotiation and unsupported-version long headers before
applying Quic v1 Initial-specific checks in process_long_header().

Version Negotiation packets randomize the long-header type bits, so
they can look like Initial packets during early parsing. Checking the
Initial DCID minimum length first can therefore reject Version
Negotiation packets, or other unsupported versions, before they reach
the correct version-handling path.

Move the version check ahead of the Initial DCID length validation and
add regression coverage for Version Negotiation and unsupported-version
packets whose type bits decode as Initial.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-05-04 14:57:59 +02:00