process_stored_dump() uses data_read() without checking the return value.
The function then uses a potentially uninitialized hdr variable.
Check data_read() return value and return the value if negative.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
DTE's can unconditionally emit a `NO CARRIER` event on the DLCI which
indicates that the channel has moved back into the command state. This
functionally means the PPP link is dead, as no more valid data will ever
be received on the channel.
Add the logic to detect this event in `modem_ppp`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Reset the receive frame state on pipe attach, and re-attach the pipe
before each PPP test to ensure a clean state.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Move subsys/demand_paging/ to subsys/mem_mgmt/demand_paging/ to
better reflect that demand paging is a memory management feature.
Also replacing source with rsource in Kconfig so top location
no longer matters.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The `max_input` variable gets reduced by 3 bytes to make room for the
size header in the first frame; it does not however get reset to its
previous value in the following frame, which permanently reduces
the frame size by three bytes.
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
`MBEDTLS_SSL_PROTO_DTLS` depends on `MBEDTLS_SSL_PROTO_TLS1_2`, so if
we are selecting the former, we must also select the later.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Cancellation can run on timeout paths where a context-based buffer
allocation timeout can expire immediately.
- allocate the temporary packed-name net_buf with K_FOREVER
- keep existing ENOMEM handling for pool exhaustion
Assisted-by: Codex:gpt-5.3-codex
Signed-off-by: Adam Szewczyk <a.szewczyk@cthings.co>
Treat resolver-side -EAGAIN as a temporary DNS condition and return
DNS_EAI_AGAIN instead of DNS_EAI_SYSTEM so callers can handle retries
consistently.
Assisted-by: Codex:gpt-5.3-Codex
Signed-off-by: Adam Szewczyk <a.szewczyk@cthings.co>
Cancel each timed-out DNS request before retrying and reset the local
semaphore state between attempts. This prevents stale delayed callbacks
from touching stack-backed getaddrinfo state after timeout progression.
Assisted-by: Codex:gpt-5.3-Codex
Signed-off-by: Adam Szewczyk <a.szewczyk@cthings.co>
The scan parameter is in units of 10ms in the Zephyr API, however the same
value was being treated differently for active and passive scanning. For
passive scanning the value got passed to the timeout as 10ms units, however
with active scanning it was treated as seconds by passing it to the
K_SECONDS() macro. Fix this by treating it as 10ms units in both cases.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Convert the scan command parameters to use getopt. While we're at it, get
rid of the confusing "dups" "nodups" options which actually behaved in the
inverse to their names ("nodups" would give you duplicate results while
"dups" would not). The new parameter is called the same as in the Zephyr
API and HCI, namely --filter-dups.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add support for specifying the exact advertising interval for the
"advertise" shell command. The new support is done with the help of
getopt, and since this is the first user of it in the Bluetooth shell the
appropriate select statement is added in Kconfig.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add Message Access Profile (MAP) shell command support to the
Bluetooth shell module.
Add map.c to the CMakeLists.txt build configuration when
CONFIG_BT_MAP is enabled, allowing MAP shell commands to be
compiled into the shell module.
Enable MAP configuration options in the Bluetooth shell test
configuration, including both MCE (Messaging Client Equipment)
and MSE (Messaging Server Equipment) functionality.
This enables testing and demonstration of MAP profile features
through the Bluetooth shell interface.
Signed-off-by: Can Wang <can.wang@nxp.com>
Add source files and Kconfig options for Bluetooth Message Access
Profile (MAP) support.
MAP enables remote access to messages stored on a Messaging Server
Equipment (MSE) device from a Messaging Client Equipment (MCE) device.
The profile supports browsing folder hierarchies, listing messages,
retrieving message content, sending messages, and receiving event
notifications.
Add Kconfig options to enable MAP profile with separate options for
MCE and MSE functions.
Add logging configuration for MAP module.
Signed-off-by: Can Wang <can.wang@nxp.com>
Remove casting of the attr->user_data for short vendor value and
instead directly use the defined `vnd_value`.
Use the same defined max length for the long_vnd functions, instead
of the sizeof operator on one of the arrays.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Fix issue with hardware `crc16()` calculation using the hardcoded value of
CRC16_POLY instead of the user's argument.
Signed-off-by: Guy Shilman <shilmanguy@gmail.com>
Add Phone Book Access Profile (PBAP) implementation for Bluetooth Classic,
supporting both Phone Book Client Equipment (PCE) and Phone Book Server
Equipment (PSE) roles.
PBAP enables remote access to phone book data stored on a device,
allowing clients to retrieve contact information, call history, and
other phonebook-related data.
Key features:
- PCE (client) and PSE (server) role support
- RFCOMM and L2CAP transport layer support
- Pull phone book, vCard listing, and vCard entry operations
- Set phone book navigation (up/down/root)
- Abort operation support
- OBEX authentication (challenge-response with MD5)
- Application parameters for filtering and formatting
- SDP service registration and discovery
- Single Response Mode (SRM) support for GOEP v2
- Configurable PSE features (download, browsing, database identifier,
folder version counters, vCard selector, enhanced missed calls, etc.)
- Configurable PSE repositories (local phonebook, SIM, speed dial,
favorites)
The implementation includes:
- Core PBAP protocol handling (subsys/bluetooth/host/classic/pbap.c)
- Public API header (include/zephyr/bluetooth/classic/pbap.h)
- Internal definitions (subsys/bluetooth/host/classic/pbap_internal.h)
- Shell commands for testing and demonstration
(subsys/bluetooth/host/classic/shell/pbap.c)
- Comprehensive shell documentation with usage examples
(doc/connectivity/bluetooth/shell/classic/pbap.rst)
- Kconfig options for feature and repository configuration
- Build system integration (CMakeLists.txt)
- Logging support
Authentication uses PSA Crypto API (MD5) for nonce generation and
response digest calculation.
Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
Decouple NET_HOSTNAME_MAX_LEN from NET_HOSTNAME_DYNAMIC to resolve
Kconfig conflict when using POSIX networking with unique hostname
updates. This restores functionality that worked in Zephyr 3.6.
- Remove forced selection of NET_HOSTNAME_DYNAMIC from POSIX_NETWORKING
- Make NET_HOSTNAME_MAX_LEN available independently
- Add build assertions for hostname length validation
- Update test configurations for new dependency structure
Fixes: zephyrproject-rtos#95811
Signed-off-by: Pragati Garg <pragatigarg@eaton.com>
Add ZSOCK_QUIC_SO_CERT_CHAIN_DEL socket option that can be used
to delete the CA cert chain from the connection socket.
Add a test to verify that the deletion works as expected.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Change the code so that user does not set intermediate cert chain
directly by ZSOCK_QUIC_SO_CERT_CHAIN_ADD, but the setsockopt() is
given a sec_tag_t type value. Then when building the certificate
message, we resolve the actual cert from certificate storage using
the given security tag value.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for STOP_SENDING frame. This is sent to tell
peer to stop sending data to the stream.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Try to send 8kb buffer multiple times, make sure that there
are dropped packets and verify that all the data is received
correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
There's no need for bt_dev.random_addr to be a bt_addr_le_t, since the type
is always implicitly random. Change it to bt_addr_t and make the necessary
updates to the host code as well as host unit tests.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Currently, TRACING_BACKEND_UART depends on UART_CONSOLE. This is overly
restrictive because the UART tracing backend relies entirely on the
generic UART driver APIs and does not utilize console subsystem.
Signed-off-by: Jedrzej Czykier <jczykier@antmicro.com>
This commit removes the initialization check on every sys_csrand_get() and
the lazy initialization of the psa crypto on the first call to
sys_csrand_get().
The psa initialization is assumed to be performed prior to the first
call to sys_csrand_get().
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
Ifdef the AAR/CCM/ECB DMA related code based on the HAL macro which tells
if the new EVDMA is present in the device, instead of particular devices,
so we do not need to ifdef on several devices as new devices are added
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
native_tap only queued TX timestamp callbacks for gPTP packets, which
left PTP SO_TIMESTAMPING socket traffic without TX timestamps.
Add host-clock packet timestamp updates in native_tap TX/RX paths, queue
TX timestamp callbacks when net_pkt_is_tx_timestamping() is set (while
preserving gPTP behavior without double-queueing), and propagate
SO_TIMESTAMPING TX/RX flags for AF_PACKET packets in net_context.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Add Layer-2 (EtherType 0x88F7) transport support and the PTP stack
updates needed for L2 operation.
Use recvmsg() RX timestamping on IEEE 802.3 sockets and fall back to
recvfrom() when ancillary timestamp data is unavailable, retrying
recvmsg() later so L2 reception keeps working across runtime and driver
limitations. Register Delay_Req TX timestamp handling for both UDP and
L2 paths and suppress expected UDP parse warnings while L2 is enabled.
Also wake the PTP worker when pollfd or state-decision changes require
it, and clear pending Sync, Delay_Req, and foreign clock state when a
port is disabled so stale state is not carried across reopen or link
transitions.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Timestamp callbacks can unregister themselves or other callbacks while
net_if_call_timestamp_cb() is iterating the callback list. That path
runs under the timestamp callback lock, so immediate unregister can
re-enter the same lock and stall the TX timestamp thread.
Handle unregister requests from the dispatch thread by marking callbacks
inactive, skip inactive entries during iteration, and prune them after
dispatch completes.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Use NET_CMSG_SPACE() when checking ancillary buffer capacity and
account for aligned cmsg storage in msg_controllen.
This keeps recvmsg() control-data handling consistent with cmsghdr
layout and avoids under-reporting consumed control-buffer space.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Implement AF_PACKET recvmsg() support and deliver ancillary
SO_TIMESTAMPING data to packet socket users.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Store the first foreign Announce and compare it against the previous entry.
Fix the BTCA receiver-port tie-break to avoid false role decisions.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Re-add __ASSERT_NO_MSG in bt_uuid_to_uuid() for invalid UUID types.
This was removed in commit 9906fdb to work around a pre-existing ASCS
memcpy bug that has since been fixed.
Add return value checking for all snprintk() calls in bt_uuid_to_str()
per Zephyr coding guidelines. Since the function returns void and uuid.c
has no logging, __ASSERT_NO_MSG is used to catch encoding errors in
debug builds while preserving the existing silent-truncation behavior.
Follow-up from: https://github.com/zephyrproject-rtos/zephyr/pull/103817
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
The valid_conn_cte_tx_params() function checked BT_DF_CTE_TYPE_AOD_1US
twice instead of checking both BT_DF_CTE_TYPE_AOD_1US and
BT_DF_CTE_TYPE_AOD_2US. This allowed AoD 2US to bypass the antenna
switch pattern validation in the host.
The controller also validates these parameters, so the impact is
limited to a missing defense-in-depth check in the host layer.
Signed-off-by: Andre Viegas <andreviegas@piscodeluz.org>
Assisted-by: Claude:claude-opus-4.6 ForgeQL
Add the EU868 region implementation for the native LoRaWAN backend.
Gate regions not yet implemented in the native backend behind depends on
!LORA_MODULE_BACKEND_NATIVE so they cannot be selected.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add a native LoRaWAN 1.0.x Class A implementation that talks directly to
the LoRa radio driver, replacing the Semtech loramac-node dependency.
The backend provides:
- OTAA join (Join Request / Join Accept)
- Unconfirmed and confirmed uplinks with Class A downlink reception
- AES-128 cryptography via PSA Crypto (CMAC for MIC, ECB for payload
and join-accept encryption)
- Region operations interface for channel plans, datarate tables,
RX window parameters, and duty cycle enforcement
- Asynchronous engine thread that serializes MAC operations
- Full downlink dispatch with deferred callbacks on the system
workqueue to avoid deadlocking the engine thread
Signed-off-by: Carlo Caione <ccaione@baylibre.com>