Having a checksum of zeros in UDP means "missing checksum" and is a
valid case as per RFC 768:
"An all zero transmitted checksum value means that the transmitter
generated no checksum (for debugging or for higher level protocols
that don't care)."
Such support is made possible by adding a new Kconfig option named
CONFIG_NET_UDP_MISSING_CHECKSUM.
However, that is valid only for IPv4. For IPv6, see the RFC 2460
section 8.1:
"Unlike IPv4, when UDP packets are originated by an IPv6 node, the UDP
checksum is not optional."
So the UDP checksum will always be verified in IPv6.
Fixes#16375
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
From RFC 768, in "Fields":
"If the computed checksum is zero, it is transmitted as all ones"
Fixes#16379
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If CONFIG_POSIX_API is defined, automatically use time() function.
The alternative to that is to explicitly configure mbedTLS' timing
source via API, as required for "raw code", but if user enables
POSIX API, we as well might use existing mbedTLS integration.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Added support for the LE SC pairing with the OOB data. The peripheral
side is only supported for now.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This change extends the Bluetooth API to support pairing with the OOB
data that are used in the Authentication Stage of the pairing procedure.
The LE Secure Connections specific API for OOB pairing is also added.
The general OOB API should be able to accomodate the LE legacy pairing
later on.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
The the footer structure and extra bytes (rssi, resolving index etc.)
were overlapping in memory, rx_ftr was moved into the header, but the
extra and footer are still being read from the same place, extra was
written to the end. So this avoided memory corruption, but reading extra
reads wrong information.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added a test case with corner case scenario, in which sector closing
operation is interrupted (e. g. due to power-down).
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added a new runtime parameter to the Flash Simulator. It can be used to
ignore part of the data that is written to the simulated flash memory.
This parameter works together with max write calls parameter.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added a new runtime parameter to the Flash Simulator. It can be used to
ignore erases to the simulated flash memory after a certain number
of flash erase calls has been executed.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added option profiling instrumentation which can help determine
string duplicates pool configuration. Added shell command to
read current peak utilization of the pool.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Create a dedicated connector file to hold arduino connector
information for disco_l475_iot board.
This should enhance board dts file readability.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT is taken into
account when allocating the area for the interrupt stack
using the K_THREAD_STACK_DEFINE macro. Therefore, we can
simplify how the top of the stack is derived during the
initialization of the system, by removing one more
occurrence of CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Adds a new argument to the jlink runner to reset the device after
loading code to flash. This fixes a problem with the lpcxpresso54114
board where it was necessary to manually reset the board to get new code
to start running after the 'ninja flash' command. This new argument is
optional and false by default because there are some cases were we must
not reset after load, such as when we load the application into ITCM on
imx rt devices.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Kconfig symbols I2C_STM32_V1 and I2C_STM32_V2 depends on SoC reference
and user should not have the possibility to choose one or the other.
Remove prompt on these symbols.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
I2C_STM32_V1 and I2C_STM32_V2 are Kconfig symbols used to
select STM32 I2C driver variant based on I2C IP available on a
given STM32 SoC.
Being SoC dependent, they are automatically selected in soc/
if CONFIG_I2C is set. Then there is no need to define them at board
level, nor for a specific application like this is done in
some sample or test applications. Remove these definitions when
this is the case.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
If the QMSI is not configured in (in the west manifest) we get kconfig
whitelisting errors because the type is declared within the module
itself.
Change default to def_bool to set the type.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove a redundant #ifdef CONFIG_MULTITHREADING guard
for a code block already inside CONFIG_MULTITHREADING.
Add some inline #endif comments for ease of reading.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
For architectures with custom swap to main, currently:
- arm
- posix
we are now using K_THREAD_STACK_SIZEOF macro to pass the
main thread stack size to z_arch_switch_to_main_thread().
This does not introduce any behavioral changes for posix;
the K_THREAD_STACK_SIZEOF() simply returns the sizeof()
the stack object. For Arm, this allows us to clean-up one
more occurence of CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT
in kernel_arch_func.h.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Fix compilation issues in central_hr or peripheral_hr sample when using
split LL and privacy is enabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The node_rx buffer does not contain the data from the connect ind, so
copy it over.
Also back up the adv pdu chan_sel bit so that it can be used to properly
select the correct channel selection algorithm
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The node_rx buffer for the connect ind buffer is being reused to send
connection complete event, make sure all data is backed up before
reusing the buffer.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The privacy state variables rl_idx and rpa_gen was not initialized
properly, which results in connection failing to be established.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add support for the Low Power Inter-Integrated Circuit (LPI2C)
controllers found in the NXP Kinetis KE1xF SoC series.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
commit 79672d16 was missing the fact socket layer is putting net_pkt
into a k_fifo. However, it's on receiving side only: at this point the
k_fifo_put is using the k_work area which is then useless at this
point Thus why it did not break anything, as k_fifo only needs 4 bytes
while the k_work attribute takes 12 bytes.
Thus adding a union on the k_work attribute with another new attribute
that describes the behavior.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Added a test for testing full round GC on 3-sectors
configuration. In this case all kind off sector can
appeared so this test covers well more numerous
sectors configurations.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Fix that removes magic numbers from the code that
leaded to the error codes that was hard to explain.
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Make headers look like this instead:
/* From ${ZEPHYR_BASE}/arch/common/isr_tables.ld: */
Besides being shorter and more "private", this makes the content of
snippets-*.ld files the same no matter who built them and where.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Commit 88fb8bacfb ("scripts: improve west build's board handling")
lets us specify the board with a build.board config or BOARD
environment variable.
However, under some conditions, e.g. if the use has
build.pristine=auto and build.board=some_board, the following fails a
check_force call:
west build samples/hello_world
west build samples/philosophers
The problem is that the check_force wasn't made aware of the other
places a board can come from. Fix that.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
The module processing logic in Zephyr requires Python, since it uses a
Python script to locate and process the modules. It is therefore
required to find the Python executable using CMake before actually
including the CMake script that processes the modules. In order to
prevent this from happening again, move the inclusion of version.cmake
as well in case that script chooses to use Python in the future.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
With the addition of a local CMake variable ZEPHYR_BASE that mirrors the
value of the environment variable the documentation build broke on
Windows. This is because CMake was incorrectly interpreting backslashes
present in the Windows path as escaping characters. In order to avoid
this, use CMake's built-in file(TO_CMAKE_PATH) functionality, which
converts the path to a canonical version using forward slashes only.
At the same time rework boilerplate.cmake to use the same mechanism
instead of manually replacing backslashes and removing trailing ones.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The "select" command has been implemented, which allows user to
narrow down the command tree.
This implementation differs from the "select" command available
in the legacy shell. In a new implementation, if the selected
command has a handler and if the user has not entered the
registered subcommand, the shell will call the handler of selected
command and pass the text as arguments.
This may be useful, for example, if someone wants to use the
shell as an interface to a modem that supports AT commands.
Instead of each time you write e.g:
at at+command1
at at+command2
at at+command3
user can execute following commands:
select at
at+command1
at+command2
at+command3
where:
at - root command for passing at commands to the modem
at+commandX - at command passed to the modem.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Like for other choices, it's the prompt that gets displayed within the
parentheses, not the symbol name.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Takes a while to figure out what it's there for, so explain what it does
and give an example of a good use for it.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The 32bits one can hold up to about 50 days, this is more than enough
knowing that ARP request timeout is 2 seconds.
So reducing the request start time to 32bits.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This attribute was used when net_pkt where queued into a fifo. However,
since the cove to k_work queues (due to the introduction of TC), such
attribute has been totally useless.
Removing it gains 4 bytes in net_pkt structure.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
As the prj_base.conf was renamed to prj.conf by commit
4e5300ba7f, the documentation
needs some fixing too.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Do not always print general help for ping cmd. Only if user supplies
'-h' or '--help' command, print information about the parameters.
After this the generated HTML documentation looks better for the
ping command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>