There are some poorly compliant mdns responders on the network
that will respond with zero counts on the answers and the additional
records (in addition to the qdcount). So, this removes the checks
in the unpack method since this is a "valid" DNS packet but the
logic is already partially handled in the dns_read code already.
An example packet can be seen in this decode
0000 33 33 00 00 00 fb 9a f8 c3 0c 07 0b 86 dd 60 07 33............`.
0010 c4 e4 00 14 11 ff fe 80 00 00 00 00 00 00 98 f8 ................
0020 c3 ff fe 0c 07 0b ff 02 00 00 00 00 00 00 00 00 ................
0030 00 00 00 00 00 fb 14 e9 14 e9 00 14 f1 64 00 00 .............d..
0040 84 00 00 00 00 00 00 00 00 00 ..........
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Source Port: 5353
Destination Port: 5353
Length: 20
Checksum: 0xf164 [unverified]
[Checksum Status: Unverified]
[Stream index: 2]
[Stream Packet Number: 1]
[Timestamps]
UDP payload (12 bytes)
Multicast Domain Name System (response)
Transaction ID: 0x0000
Flags: 0x8400 Standard query response, No error
1... .... .... .... = Response: Message is a response
.000 0... .... .... = Opcode: Standard query (0)
.... .1.. .... .... = Authoritative: Server is an authority
for domain
.... ..0. .... .... = Truncated: Message is not truncated
.... ...0 .... .... = Recursion desired: Don't do query recursively
.... .... 0... .... = Recursion available: Server can't do
recursive queries
.... .... .0.. .... = Z: reserved (0)
.... .... ..0. .... = Answer authenticated: Answer/authority
portion was not authenticated by the server
.... .... ...0 .... = Non-authenticated data: Unacceptable
.... .... .... 0000 = Reply code: No error (0)
Questions: 0
Answer RRs: 0
Authority RRs: 0
Additional RRs: 0
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
Full CMUX frames are way too much to fill the debug log
so disable those by default.
Sometimes it is enough to see the CMD and response types, without
hexdump.
Added also debug messages for opening and closing events.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
This reverts commit 77f19eb1b5.
This dependency was misplaced. See the parent commit.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
The ZMS backend for Settings uses the `flash_area` API, which means it
requires CONFIG_FLASH_MAP to be enabled, so update Kconfig accordingly.
Note that ZMS itself does not depend on this.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
It is essential for the overwrite mode to allow confirming the secondary
slot to provide the permanent update.
This types of updates is the only mode in which the application may be
upgraded.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
Fix the incorrect usage of Kconfig symbols and revert back the default
behavior to allow for non-active slot confirmation.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
Fix the issue reported by Coverity CID 487708. The LL_ASSERT was
performed on lll->ptc, which is a 4-bit bitfield and therefore always
succeeds. Instead, the computation (lll->nse - nse) should be checked
to ensure it falls within the 4-bit value range before assigning it
to lll->ptc.
Signed-off-by: Loic Domaigne <tech@domaigne.com>
Initialize the UART configuration from the default line coding
when the CDC ACM device is started. This ensures that the UART
configuration matches the default line coding until the host sets
the line coding for the first time.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Use default_unicast_group everywhere in the CAP shell, and mark
all creation of it as default_unicast_group.is_cap = true.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the function bap_ac_create_unicast_group to the CAP
shell, as that was the only user of it, and rename it to
cap_ac_create_unicast_group, and make it use the CAP API.
Also rename bap_unicast_ac_param to cap_unicast_ac_param
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a common unicast_group struct for both the BAP and
CAP shell, similar to the broadcast_source.
The purpose of this is to be able to use the appropriate type
for both the CAP and BAP shells, instead of using the BAP
unicast group for the CAP shell.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When running just the test mqtt_sn_client::test_mqtt_sn_wait_suback on
native_sim, the current timestamp is still 0. That caused the test to fail,
because 0 is used as an indicator, that the message has never been sent,
thus sending it every time process_work is executed.
Instead of adding additional variables and complexity, the code now simply
treats now==0 special and waits 1ms until doing anything.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
- The paho client does that, too.
- This allows running single tests, because they don't rely on previous
ones having incremented the msg_id a certain number of times.
- The variable already existed in the client struct, but wasn't used. I
guess it was intended that way but never implemented.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Making the assumption, that mqtt_sn_connect does not process any incoming
data allows for this to be a very simple, additional API function instead
of adding more complexity to the connect function. This also means that the
user has to re-add predefined topics upon reconnects which don't reuse the
old session though.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
This reworks the Intel audio DSP host IPC driver as a backend of
the IPC service. This is the first step to rework IPC in SOF
(Sound Open Firmware) into using a more generic IPC API instead
of a SoC specific one.
For now, it keeps the old interface to maintain usability
as it is going to be a multiple process to rework IPC
over there.
Also, the structure of the new IPC backend resembles
the SoC specific driver to make it easier to compare
between them at this first iteration. Future optimizations
will probably be needed once we start modifying the SOF
side to utilize the IPC interface.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds support for the user defining their own channels within the
fixed L2CAP channel range. To make this possible, the
`bt_l2cap_fixed_chan` struct and `BT_L2CAP_CHANNEL_DEFINE` macro
needed to converted to public API. In the process of doing so, the
`_destroy` parameter was removed from the `BT_L2CAP_CHANNEL_DEFINE`
macro as it was never used (fixed channels will not be destroyed over
the lifetime of the connection). `BT_L2CAP_CHANNEL_DEFINE` is renamed
`BT_L2CAP_FIXED_CHANNEL_DEFINE` to avoid confusion
The `bt_l2cap_chan_send` function is updated to be able to send data
on fixed l2cap channels.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Rename the bt_bap_is_x_ep functions to better match the
modules where they are implemented.
Additionally modify the check to use IS_ARRAY_ELEMENT
in the broadcast sink and source for a stricter check.
IS_ARRAY_ELEMENT cannot easily be used in the unicast
client and server, as the endpoints are part of another
structure.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
We check for all other roles when checking whether
an endpoint can send or receive, except for the unicast server.
It is technically implied, but if the ep is not a valid pointer,
then we may access invalid memory.
Add check for bt_bap_ep_is_unicast_server (which uses the new
bt_ascs_has_ep function).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement the broadcast to unicast handover procedure,
as per the Bluetooth CAP specificiation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Extend the gen_isr_table test to support the Hazard3 cores on the
RP2350A. This allows some testing when building and running using flash,
but it seems like Twister builds with different flags. It's unclear if
this is intended or not.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Commit 48897a9090 fixed the address
mapping for dual-stack sockets when sendmsg() was used, however the same
similar issue appears (cannot check for AF_INET family for mapped
addresses as those are AF_INET6) for regular sendto() calls.
Therefore, for the sendto() case, where dst_addr is specified, check if
the address is mapped with net_ipv6_addr_is_v4_mapped() function as
well.
This also fixes another bug in sendmsg() case, where msghdr->msg_name
could've been dereferenced even if it was NULL (for example in case
of a connected socket).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Don't enable `ZTEST_NO_YIELD` when `COVERAGE_DUMP` is enabled, since
this option spins forever at the end of `main`, while `COVERAGE_DUMP`
occurs after `main` returns into `bg_thread_main`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The subsystem has been out for a year.
It has been taken into use by various parties and has gone through
additional downstream testing.
It is considered stable and mature enough to not be experimental
anymore.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Instead of returning storage-related error codes, return ones which
make it clear that it's not about the storage itself.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Moved the Open AMP code from lib/ to subsys/ipc/ to better
organize IPC-related components.
Updated build and config files to reflect the new location.
Adjusted path in MAINTAINERS.yml.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
When logging through shell is enabled, it is inconvenient to use
the shell when there are logs coming in. Having a mechanism for
easy disabling/re-enabling the shell logs is a nice quality of life
feature.
To toggle the logs, `CTRL+T` combination can be used. This is
available only when meta key feature is enabled.
Signed-off-by: Heghedus Razvan <heghedus.razvan@protonmail.com>
It is easier to debug things when both the relative and absolute
TCP seq and ack numbers are printed in debug prints.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use the socket eof flag to determine whether the receive
callback should be installed. If the receive cb is not installed,
then the socket cannot receive any data.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If there is received data in the TCP or UDP socket, discard it in order to
avoid leaking net_bufs because we are only sending data out and should
not receive anything.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The logging net backend will send syslog messages to syslog server and
it is not meant to receive anything. If we bind to a local socket, it will
create UDP server socket that can receive data. Unfortunately there is no
one reading the data so we will eventually run out of memory in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This PR includes OpenThread's NAT64 header file when
NAT64_TRANSLATOR is enabled. This is done to avoid compile
warnings when OT NAT64 API is used.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
Some pieces of the system may have custom types of constraints that they
define based on different effects and reasons than just the standard
"zephyr,disabling-states". To avoid every single one of these component
reinventing the wheel, make some common APIs to handle these type of
custom constraint lists.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
I am surprised this notifier didn't already report the substate id, it
seems important since different substate obviously are defined for a
reason, they can be having a different effect on the system.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.
The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.
The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected by an `#if` condition.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.
In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, a `memset` is used, which should be optimized away
by the compiler when appropriate.
The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Ethernet TX should not handle bridge forwarding. The bridge layer
had already handled forwarding.
Current code is causing duplicated TX if sending is via bridge
interface, or causing needless TX on other bridge ports if sending
is via one bridge port.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
There were several problems of pkt management during forwarding.
1. No need to do net_pkt_ref/net_pkt_unref around net_if_queue_tx.
2. Finally when completed forwarding, there was a net_pkt_unref for
pkt using cloning. However it also applied to pkt not using
cloning. This was causing pkt was released before sending.
3. Whether pkt cloning used or not, should not be decided by bridge
interfaces count. It's should be decided by interface count to
forward.
An example was sending pkt via bridge interface. If there were
two interfaces attached to bridge, cloning was needed but current
code won't.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
If stream->ep is NULL, which is really shouldn't be,
then we should not attempt to dereference it.
Add simple NULL check to ensure behavior, and make
Sonarcloud happy.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Change 4c86a5cc8d moved a select
from Kconfig.asc to Kconfig.bap (amongst some other changes
from select to depends), but inverted the PAC_{SRC,SNK} from
ASCS_ASE_{SRC,SNK} condition.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Fix inter-operability, when BT_PHY_UPDATE=n the feature bits
contained 2M and Coded PHY when Advertising Extensions where
enabled, and Central devices did not progress with any data
packet transfers when PHY_REQ was rejected as unknown PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
- Initialize platform requirements and start OpenThread DHCP6_PD
feature.
- Added initialization logic for DNS upstream resolver.
OTBR message data structure has been updated to store a user data
structure, if needed.
- Added SRP server initialization call.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>