Commit graph zephyr/subsys
Author SHA1 Message Date
Fin Maaß
e5b97204af drivers: ethernet: remove ETHERNET_CONFIG_TYPE_T1S_PARAM
In #90652 we removed phy related config from eth api,
unfortunatly ETHERNET_CONFIG_TYPE_T1S_PARAM was forgotten
to be removed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-04-30 14:06:31 -04:00
Johann Fischer
a055ab70c2 usb: host: fix copy and paste mistakes in shell outputs
Fix copy and paste mistakes in shell outputs. Remove unnecessary
shell_error() in device descriptor command.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-04-30 14:04:45 -04:00
Johann Fischer
b5ca615467 usb: host: clear root device if initialization failed
Otherwise, the disconnect event handler will attempt to free unallocated
resources.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-04-30 14:04:45 -04:00
Riadh Ghaddab
a5e7080de5 kvss: zms: add mount flags to control mount behavior
Add mount_flags to zms_fs structure to be able to control the mount
operation.
If ZMS_MOUNT_FLAG_NO_FORMAT flag is enabled, no header will be added to
an erased memory and it will return -ENOTSUP error.

Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
2026-04-30 14:04:30 -04:00
Lyle Zhu
c67b59f891 bluetooth: classic: rfcomm: fix race condition in session disconnect
Fix a race condition in RFCOMM session disconnection when both local
and peer devices initiate disconnection simultaneously.

Add state check in `rfcomm_session_disconnected()` to only transition
to `DISCONNECTED` state if the session is not already in
`DISCONNECTING` state. This prevents the race condition where both
sides set the session to disconnected, causing the disconnection
process to not complete properly and leaving the L2CAP connection
unreleased.

Without this check, subsequent RFCOMM channel connection requests
would fail due to the invalid session state (the expected state is
`IDLE`, while the actual state is `DISCONNECTED`).

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-30 14:03:39 -04:00
Emil Gydesen
e60165f45b Bluetooth: TBS: Add enum, move and rename TECHNOLOGY
The technology values defined in tbs.h are actually defined
in assigned numbers under the HFP. They have been moved to
the assigned_numbers.h file, and name to match the placement
in Assigned Numbers. They have been defined in an enum instead
of multiple #define's, to more easily refer to them.

The callback for reading technology was likewise updated to use
the new enum.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-30 13:59:23 -04:00
Kai Cheng
1cb1d41335 Bluetooth: SPP: Add SPP test command set
Add SPP test shell commands, support client and server features.
include register, connect, send and disconnect.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-30 13:58:42 -04:00
Kai Cheng
6326394734 Bluetooh: RFCOMM: remove rfcomm test shell
remove rfcomm test shell, and instead
with spp test shell

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-30 13:58:42 -04:00
Nicolas Pitre
9bb2878319 net_buf: make reference counts atomic
The two reference counts in the net_buf library -- the per-header
`buf->ref` and the per-data-block `*ref_count` byte at the start of
each variable-data allocation -- were manipulated with plain non-atomic
C operators (`++`, `--`, `if (--rc)`, `if (!rc)`).

The documented contract says otherwise. The Network Buffers chapter of
the Zephyr docs (`doc/services/net_buf/index.rst`) states:

    "The buffers have native support for being passed through k_fifo
     kernel objects. Use k_fifo_put and k_fifo_get to pass buffer from
     one thread to another."

    "The reference count can be incremented with net_buf_ref() or
     decremented with net_buf_unref(). When the count drops to zero the
     buffer is automatically placed back to the free buffers pool."

There is no requirement for callers to hold a higher-level lock around
ref/unref. The API is documented as self-synchronizing, and existing
users (notably zbus's msg-subscriber path) rely on exactly that:
a producer clones a buffer N times and hands the clones off to N
subscriber threads via their FIFOs, after which the N+1 holders
independently call `net_buf_unref()` with no surrounding lock.

With non-atomic decrement-and-test, two CPUs can concurrently observe
the same prior value (e.g. 1), both decrement, and both conclude they
were the last reference. Concrete failure modes:

  * `mem_pool_data_unref`: both CPUs call `k_heap_free(pool, ref_count)`
    on the same block. `k_heap_free` is internally serialized, so the
    duplicate free typically corrupts heap metadata silently.

  * `heap_data_unref`: both CPUs call `k_free(ref_count)` on the same
    block. `k_free` reads the owning `struct k_heap *` from the 8 bytes
    immediately preceding `ref_count`. The first call frees the block
    and the heap-hardening fill replaces those 8 bytes with the poison
    pattern (0xcfdfdfdfdfdfdfcf). The second call then dereferences a
    poisoned pointer and faults inside `k_spin_lock` (translation
    fault on the bogus heap address).

  * `net_buf_unref`: two CPUs racing the per-header decrement-and-test
    can both decide "I am the last reference," both proceed to
    `net_buf_destroy()`, and the buffer is returned to the pool's LIFO
    twice -- silently corrupting the free list.

Fix: use atomic operations on both reference counts.

The per-data-block refcount changes from `uint8_t` to `atomic_t`. This
fits inside the existing `GET_ALIGN(pool)` reservation (>= sizeof(void
*)) at no memory cost.

The per-header `buf->ref` is overlaid in a union with three small
adjacent uint8_t fields (`flags`, `pool_id`, `user_data_size`) and an
`atomic_t ref_word` view of the same storage:

    union {
        atomic_t ref_word;
        struct {
            uint8_t ref;
            uint8_t flags;
            uint8_t pool_id;
            uint8_t user_data_size;
        };
    };

(Byte order conditional on endianness so `ref` is always the LSB of
`ref_word`; on big-endian 64-bit, the byte struct is shifted by 4
bytes of padding for the same reason.)

Net_buf internals issue `atomic_inc(&buf->ref_word)` /
`atomic_dec(&buf->ref_word)` and narrow the returned word value to
`uint8_t` to extract the ref byte. Because the ref count is bounded
to 254 (already implicit in its uint8_t domain), atomic_inc/dec
adjusts only the LSB; the other three bytes are untouched. Plain
uint8_t reads of `buf->ref` from non-atomic call sites continue to
work, so the change is transparent to the dozens of consumers that
read it for diagnostics.

`flags`, `pool_id` and `user_data_size` are written exactly once at
allocation time on a single thread (or, for `flags`, from a context
that owns the buf exclusively such as bt_buf_make_view on a fresh
view), so there are no concurrent byte writes that could conflict
with the atomic word update. struct net_buf does not grow on either
32-bit or 64-bit: on 32-bit the four bytes are exactly `sizeof(long)`,
on 64-bit they fit in alignment padding the next field already
required.

A BUILD_ASSERT in lib/net_buf/buf.c documents the
`atomic_t == long` assumption that the conditional padding relies on.

In `net_buf_unref`, the per-header refcount and the fields needed for
the debug log (`buf->pool_id`) are captured into local variables
*before* the atomic decrement -- once the reference is dropped, another
CPU may immediately free the buffer, so the buffer must not be read
again. The post-decrement diagnostic log uses the value returned by
`atomic_dec` rather than re-reading `buf->ref`. The `pool->avail_count`
sanity check uses the value returned by `atomic_inc` to avoid a
follow-up `atomic_get` of memory another CPU may have changed.

`net_pkt_frag_unref()` previously had the racy
`if (frag->ref == 1U) alloc_del(); net_buf_unref();` pattern; it is
restructured to do the atomic decrement here and slot the tracker call
in atomically with the "I'm the last reference" decision, with
`net_pkt_frag_del()` routed through it.

This bug had been latent. On real SMP hardware the race window is very
small and the typical net_buf consumers (Bluetooth, networking) tend
to use fixed-data pools (`fixed_data_unref` is a no-op). The race
manifests reliably under FVP, where the FastModel's quantum-based
execution model can schedule N threads to all reach the unref point in
the same simulated moment. We discovered it through the zbus
`msg_subscriber_dynamic_isolated` sample, which exchanges shared data
buffers among 16+ subscribers running on 4 SMP cores.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-30 07:52:34 +02:00
Rithic Chellaram Hariharan
aee363011e samples: tests: net: migrate to asymmetric TLS content length Kconfig
Replace CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN with the new
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN and CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN
options across all in-tree .conf files, hostap Kconfig defaults, and
socket subsystem help text.

This completes the deprecation of MBEDTLS_SSL_MAX_CONTENT_LEN in favor
of independent incoming/outgoing buffer size control.

Signed-off-by: Rithic Chellaram Hariharan <gr8rithic@gmail.com>
2026-04-30 07:51:57 +02:00
Kai Cheng
5b11f77fe3 Bluetooth: Classic: add sniff subrating support
Add bt_conn_br_set_sniff_subrating() API to configure sniff subrating
parameters for BR/EDR connections. Sniff subrating allows further
power savings by reducing the number of sniff anchor points the
device needs to listen on.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-30 07:50:34 +02:00
Marcin Niestroj
94bf4c8132 net: sockets: tls: handle NewSessionTicket in tls_data_check()
Handle NewSessionTicket in poll() syscall (via tls_update_pollin() and
tls_data_check()) similar as it is handled in recv() / read() syscall (via
recv_tls()).

This event is semantically the same as "want read" and "want write", since
it does not contain any application data or error. This means that we just
want to proceed with reading and not treat that as error.

Fixes: 6be57aaedf ("net: sockets_tls: add support for TLS 1.3")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2026-04-29 16:34:39 -04:00
Roman Leonov
57a430c679 usb: host: shell: rename list_dd command to info
Rename list_dd command to simplified info.

Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
2026-04-29 16:34:24 -04:00
Kai Cheng
0cb96d2b2e Bluetooth: Classic: group BR/EDR callbacks into struct bt_conn_br_cb
Introduce struct bt_conn_br_cb to group all BR/EDR specific connection
callbacks (role_changed, mode_changed) into a dedicated sub-struct
within bt_conn_cb. This replaces the previously scattered callbacks
that were individually guarded by CONFIG_BT_CLASSIC or
CONFIG_BT_POWER_MODE_CONTROL.

Application code now uses the .br. accessor:
  .br.role_changed = my_role_changed_cb,
  .br.mode_changed = my_mode_changed_cb,

The br_ prefix is dropped from callback names since the struct
hierarchy already conveys the BR/EDR scope, aligning with the
pattern suggested during review.

Also fix bt_conn_notify_mode_changed() to use
BT_CONN_CB_DYNAMIC_FOREACH instead of SYS_SLIST_FOR_EACH_CONTAINER
for consistency with other callback notification functions.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-29 16:33:25 -04:00
Carlo Caione
e70f8670d2 lorawan: native: derive LWAN_MAX_CHANNELS from selected region(s)
The per-session channel table size is a spec-mandated property of
the region (EU868: 16, US915/AU915: 72, CN470: 96, ...) and is
not a user preference: a region needs exactly as many slots as its
channel plan defines, no more, no less.

Replace the hardcoded #define with a hidden Kconfig in the region
subdirectory.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-29 16:31:27 -04:00
Carlo Caione
0b12f16657 lorawan: native: mac: insert FOpts and ADR bit in uplink data frames
Refactor mac_build_data_frame() so uplink frames can carry MAC
commands in the FOpts region between FHDR and FPort, and set the
FCtrl.ADR bit when lorawan_enable_adr() has been called.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-29 16:31:27 -04:00
Carlo Caione
fabba3d255 lorawan: native: region: thread tx_power_idx through get_tx_params
Widen the get_tx_params() region op to accept a TX power index and
compute the effective dBm from it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-29 16:31:27 -04:00
Carlo Caione
b0299eeb16 lorawan: native: region: add helper functions for MAC commands
Add three region-ops function pointers needed by the upcoming MAC
command framework to validate and apply parameters from LinkADRReq:

  - validate_dr: is a datarate index defined in this region?
  - validate_tx_power: is a TX power index defined in this region?
  - apply_channel_mask: apply a ChMaskCntl + ChMask pair to the
    channel table, atomically (no partial mutation on failure).

Implement them for EU868.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-29 16:31:27 -04:00
Måns Ansgariusson
d78bc3aa54 net: lwm2m: Use sys_ringq to store lwm2m_time_series_elem
The lwm2m registry time series elements were previously stored in a
ring buffer which added complexity to the code when adding and removing
elements from the buffer. This commit changes the implementation to use
the sys_ringq instead, simplifying the code and making it easier to
maintain over time.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-04-29 16:28:23 -04:00
Jacob Schloss
22d3b1a662 net: mqtt: Add missing header
When building MQTT with MQTT_LIB_WEBSOCKET,
compilation fails due to implicit declaration of function 'NET_ERR'.

Add include for zephyr/net/net_log.h to pull in declaration.

Signed-off-by: Jacob Schloss <jacob.schloss@suburbanmarine.io>
2026-04-29 06:24:15 -05:00
Benjamin Cabé
2f558a5249 net: fix maybe uninitialized warnings
Fixes a few occurrences of "maybe uninitialized" variables that are
flagged when -Wmaybe-uninitialized is enabled. Seen when running e.g.
./scripts/twister -p mps2/an385 -T tests/net/lib/coap_server/common
in "--coverage" mode.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-29 10:18:27 +02:00
Philipp Steiner
87476b005c net: ptp: name networking protocol Kconfig choice
Give the PTP transport protocol choice a symbol name so tests and
application fragments can override its default through Kconfig.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-29 10:12:37 +02:00
Flavio Ceolin
58b46c81c6 net: dns: validate rdata length in dns_unpack_answer
dns_unpack_answer() validated only the fixed RR header size and
accepted any rdlength, even one extending past the end of the packet.
TXT and SRV consumers in resolve.c then read up to rdlength bytes from
the message buffer, causing an out-of-bounds read on a truncated or
crafted response.

Reject any RR whose declared rdata extends past dns_msg->msg_size at
the single chokepoint in dns_unpack_answer(), so all current and
future RR consumers are covered.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-04-29 10:01:17 +02:00
Gaetan Perrot
65585a47fc bluetooth: audio: vcp: Fix possible NULL pointer dereference
The VOCS discover callback may call vcp_vol_ctlr_discover_complete()
with a NULL vol_ctlr when lookup_vcp_by_vocs() fails.

This leads to a potential NULL pointer dereference as
vcp_vol_ctlr_discover_complete() unconditionally accesses
vol_ctlr->flags.

Fix this by returning early when vol_ctlr is NULL.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-04-29 09:59:30 +02:00
Krzysztof Chruściński
81c137d9fb logging: Adapt shell commands to the remote client
Adapt logging commands to be used by the shell remote client.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-29 09:56:21 +02:00
Krzysztof Chruściński
70389cf7ec shell: Extend shell with remote client support
Add option for remote shell client. Remote shell client is an
implementation of shell on the client core which supports
IPC communication with host shell implementation. It allows
to use host shell backends to execute commands on the remote
client. The remote client implementation takes much less
memory than the normal shell implementation.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-29 09:56:21 +02:00
Krzysztof Chruściński
aaf5bba2a0 shell: Move hexdump printing to shell_utils
In preparation for remote shell support, move hexdump printing to
the shell_utils.c file. Main shell.c file is not compiled for remote
shell client.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-29 09:56:21 +02:00
Krzysztof Chruściński
b5c9f03553 shell: Add compile time guards
Do not compile shell_help() implementation if CONFIG_SHELL_HELP=n.
In that case, empty inline function is implemented in the shell
header and it may fail to compile.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-29 09:56:21 +02:00
Krzysztof Chruściński
c61dfc6856 shell: backends: dummy: Add RX notification
When input buffer is written, notify the shell. It will wake the
shell thread which will process the input buffer.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-29 09:56:21 +02:00
Kyra Lengfeld
9f245e68f0 bluetooth: host: enable extended advertising to use spec range of intervals
Core spec defines the range of adv intervals for extended advertising to
0x0020 to 0xFFFFFF, but the code currently only allows up to 0x4000.
This change enables the full range of intervals for extended advertising

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2026-04-28 22:07:30 +02:00
Robert Lubos
095f064c94 net: ipv6: Fix ND packets validation on input
The checks validating RA, NS and NA packets content on input were not
correct - packets should be dropped in case any of those checks failed,
however current logic was invalid, causing other checks to be ignored as
long as the ICMPv6 code was correct (i. e. 0).

Apart from fixing the logic, split the single convoluted if condition
into separate if checks for better readability.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-04-28 17:53:24 +02:00
Johann Fischer
babe3f55ab usb: device_next: return EBUSY instead of ALREADY if USB device is enabled
Replace EALREADY return values of the functions that modify or set USB
device attributes to EBUSY. EBUSY seems to be more appropriate for the
case when a user tries to change the attributes of an operational
device.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-04-28 15:25:22 +02:00
Lyle Zhu
cd8c5ccd76 bluetooth: host: goep: Set MTU to configured maximum large
Remove the logic that silently clamps the MTU to valid ranges and
instead return an error if the configured MTU is below the minimum
required size.

The MTU is now always set to the maximum value that the configuration
can support, rather than conditionally using a default only when
set to 0.

Change log level from WRN to ERR for the minimum MTU check since
this now represents a fatal configuration error.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-28 15:23:28 +02:00
Emil Gydesen
531837b499 Bluetooth: ISO: Improve validate_send for conn state
ISO connections basically have 2 connection states:
1 for the `bt_iso_chan`, and one for the underlying
`bt_conn`. Due to how hci_disconn_complete_prio works,
these may be out of sync while disconnecting, and
bt_iso_chan_send could return 0 after we have received
a disconnect event from the controller. In this case
the number of pending SDUs in the host for the ISO
channel could be non-0, which could cause issues.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-28 15:21:19 +02:00
Sebastiaan Merckx
cf8980f0f7 net: dns: fix unpack of DNS record with multiple questions
The first issue is that the query offset was not properly updated.

The second issue is more complex and relates to the use of message
compression in domain names
(https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.4). The
pointers can be nested (i.e. a first pointer pointing to a label with
another pointer)
For example: _http._tcp.local can be represented via:
'_http' + (pointer to a '_tcp' label + (pointer to a 'local' label).
This was not properly implemented, only single-pointers were supported.

Signed-off-by: Sebastiaan Merckx <sebastiaan.merckx@verhaert.com>
2026-04-28 11:24:37 +02:00
Muhammad Waleed Badar
e2a5686f38 net: ip: guard multicast APIs against NULL args
Add NULL checks for iface and addr in IPv4/IPv6 maddr add/rm
to prevent potential dereferences.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-04-28 11:23:28 +02:00
Maximilian Zimmermann
451cfb77b1 Bluetooth: CSIP: make size,lock and rank characteristic optional
Make the Coordinated Set Size, Set Member Lock and Set Member Rank
characteristic optional by adding three new Kconfig options
BT_CSIP_SET_MEMBER_SIZE_SUPPORT, BT_CSIP_SET_MEMBER_LOCK_SUPPORT and
BT_CSIP_SET_MEMBER_RANK_SUPPORT. Also updates the existing examples
and tests to compile correctly.

Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
2026-04-28 11:19:29 +02:00
Emil Gydesen
0601cc8c42 Bluetooth: CAP: Shell: Reorder code in cap_handover
Reorder some of the large and complex shell command
functions, to make each function simpler to follow.
This also makes the code pass the Sonarcloud complexity
rule.

This also contain a few other various fixes and updates.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-28 11:18:50 +02:00
Emil Gydesen
2945c0be98 Bluetooth: CAP: Shell: Share args between modules
Instead of defining the same arguments in all 3 CAP files,
we declare them in audio.h and initiate them in either
the initiator or commander, depending on their use.

The reason for this change, is that the CAP Handover API
require several of the parameter to be globally/statically
allocated, and cannot just rely on stack allocated parameters.
By doing this, we can use the same argument among the
CAP shell modules, while keeping the memory usage down.
This has the additional postive effect that we do not allocate
some of these arrays, which can be quite larger, on the stack.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-28 11:18:50 +02:00
Emil Gydesen
700d3d5d49 Bluetooth: CAP: Shell: Implement cmd_cap_handover_broadcast_to_unicast
Implement the shell command for handing over broadcast to
unicast. The command supports various configurations.

It is currently limited to cases with
- 1 connection and multiple streams
- Multiple connections and 1 stream
- Equal amount of streams and connections

Cases with e.g. 3 connections and 2 streams,
or vice versa, are not support given the complexity
of these cases.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-28 11:18:50 +02:00
Emil Gydesen
531ed72256 Bluetooth: CAP: Shell: Add handover u->b shell command
Add shell command for unicast to broadcast for the CAP handover
procedures.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-28 11:18:50 +02:00
Chaitanya Tata
fb69902ff4 net: shell: Display raw packet socket statistics
Display raw packet socket statistics (recv, sent, drop, bytes) in the
"net stats" shell command output. This follows the same display format
as the existing UDP and TCP statistics sections.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:opus-4.6
2026-04-27 19:04:28 +01:00
Chaitanya Tata
33d6ac9271 net: stats: Add raw packet socket statistics
Add statistics tracking for raw/packet sockets (AF_PACKET), following
the same pattern as existing UDP and TCP statistics. This tracks packet
counts (sent, received, dropped) and byte counts for raw socket traffic.

The new CONFIG_NET_STATISTICS_RAW Kconfig option is enabled by default
when CONFIG_NET_SOCKETS_PACKET is active. Statistics are updated in the
AF_PACKET send path (net_context.c) and the packet socket delivery path
(connection.c).

Includes NET_MGMT user API support, periodic output, and Prometheus
metrics integration.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:opus-4.6
2026-04-27 19:04:28 +01:00
Emil Gydesen
78d9b474e5 Bluetooth: BAP: BA: Remove start and end handles
The two cached handles did not provide anything useful
and can be removed, thus freeing up some memory.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-27 17:28:17 +02:00
Emil Gydesen
0f0fff91b9 Bluetooth: BAP: BA: Minor fix for disc_params.uuid
Instead of allocating a generic uuid and copying the BASS UUID
to it for each discovery, we can just use declare and use it
as a constant as it won't change.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-27 17:27:22 +02:00
Lyle Zhu
dfac5224ab bluetooth: classic: sdp: Fix buffer length check in attribute parsing
Fix insufficient buffer length validation in bt_sdp_parse_attribute().
The original check only verified space for the type byte and attribute
ID, but did not account for the type variable itself that is read from
the buffer immediately after the check.

This could lead to a buffer over-read if the buffer contains exactly
sizeof(uint8_t) + sizeof(attr->id) bytes but not enough for the
additional type field.

Add sizeof(type) to the length check to ensure all required data is
present before parsing.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-27 17:25:52 +02:00
Emil Gydesen
028634623f Bluetooth: Audio: Add checks for UTF when getting broadcast name
Add checks to verify the valid length of broadcast names
in codec_cfg and codec_cap, both in terms of size in octets,
but also in terms of length in characters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-27 17:22:20 +02:00
Emil Gydesen
a259ad8311 Bluetooth: Audio: Add checks for UTF when setting broadcast name
Add checks to verify the valid length of broadcast names
in codec_cfg and codec_cap, both in terms of size in octets,
but also in terms of length in characters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-27 17:22:20 +02:00
Emil Gydesen
6548ed48af Bluetooth: CCP: Client: Add support for get bearer uci
Add support for getting the remote bearer UCI.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-27 17:21:17 +02:00
Emil Gydesen
7097c3ee0d Bluetooth: Audio: replace implicit integer-to-boolean checks
MISRA-C requires essentially boolean type in control flow.
Convert all if/while conditions using err or ret
as implicit booleans to explicit comparisons:

- if (err)  -> if (err != 0)
- Same rules applied to while statements and ret variable

Assisted-by: GitHub Copilot

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-27 14:22:32 +02:00