It is useful to return the neighbors in net_ipv6_nbr_foreach()
groupped by network interface. This way the caller has them
already in proper order and does not need to re-group them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Proxy configuration messages are allowed (in fact required) to use
unassigned addresses, so they should be exempt from this check.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The test failure may be e.g. because of an unknown company id, and in
that case the spec expects us to ignore the message.
With this patch it should be possible to pass MESH/SR/HM/RFS/BI-01-C.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
A previous patch which moved dispatching the health publish callback
to a later moment introduced a regression where the period divider
does not get updated when it should. In fact, having the divider as
part of the Health Server context is redundant, since the same
information is already stored generically in the model publication
context. Switching to using the model publication context makes things
simpler and ensures that the value is always up-to-date.
With this patch it is possible to pass MESH/SR/HM/CFS/BV-02-C.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We should ignore invalid addresses (helps pass
MESH/NODE/CFG/LPNPT/BI-01-C). Also fix a copy-paste issue in an error
log.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The values all need to be zeroed when heartbeat subscription is
disabled. This makes it possible to pass MESH/NODE/CFG/HBS/BV-01-C.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
These tests test the IPv4 multicast address add, lookup and
removal functions found for network interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There was no handler functions for adding, removing and looking up
IPv4 multicast addresses in the network interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the user tried to bind to IPv4 multicast address, then the
operation failed and returned error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IPv4 address in struct in_addr is in big endian so check
the multicast address value correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the network interface does not support IPv4 like IEEE 802.15.4
or Bluetooth, then do not print IPv4 information for those interfaces.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Some versions of make seem to more greedy about how they match
$(notdir %).inc vs $(notdir %).gz.inc. If we put the gz.inc rule first
that seems to deal with the issue.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
- syscall.h now contains those APIs needed to support invoking calls
from user code. Some stuff moved out of main kernel.h.
- syscall_handler.h now contains directives useful for implementing
system call handler functions. This header is not pulled in by
kernel.h and is intended to be used by C files implementing kernel
system calls and driver subsystem APIs.
- syscall_list.h now contains the #defines for system call IDs. This
list is expected to grow quite large so it is put in its own header.
This is now an enumerated type instead of defines to make things
easier as we introduce system calls over the new few months. In the
fullness of time when we desire to have a fixed userspace/kernel ABI,
this can always be converted to defines.
Some new code added:
- _SYSCALL_MEMORY() macro added to check memory regions passed up from
userspace in handler functions
- _syscall_invoke{7...10}() inline functions declare for invoking system
calls with more than 6 arguments. 10 was chosen as the limit as that
corresponds to the largest arg list we currently have
which is for k_thread_create()
Other changes
- auto-generated K_SYSCALL_DECLARE* macros documented
- _k_syscall_table in userspace.c is not a placeholder. There's no
strong need to generate it and doing so would require the introduction
of a third build phase.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This header could be maintained by hand since there are no inputs
and it only changes if the generating script is modified, but given
the choice to maintain 800-ish lines of extremely repetitive C
preprocessor code, or 100-ish lines of Python, the choice is pretty
clear.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Implement the Read Build Information VS command. This returns a UTF-8
encoded string, which is extendable by the user via a new Kconfig
option.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Implement the Zephyr VS command that allows a Host to write a public
Bluetooth Address to the Controller in order to allow Hosts to provide
their own public Bluetooth addresses.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
If the data parameter in net_pkt_insert() is NULL, then just
insert amount of data but clear the area instead of copying.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
User was able to tweak IPv6 hop-limit so introduce similar
feature for IPv4 Time-To-Live value.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the caller of http_client_send_req() sets the timeout to
K_NO_WAIT, then the function would still wait for a while before
returning to the caller.
Jira: ZEP-2624
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
From section 3.4.5.3 in the Mesh Profile Specification 1.0:
"A node shall implement a Local Network Interface."
Removing the Kconfig option also helps clean up quite a lot of code.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The bt_mesh_net_relay() function needs to allow TTL <= 1 for the local
network interface since that's the code path that locally originated
outgoing packets take.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Mesh Profile Specification v1.0, 5.3.3:
"On the PB-ADV bearer, when the receiver has received all segments of
a transaction, the receiver shall calculate the FCS for the received
Provisioning PDU, and if it matches the FCS field in the Transaction
Start PDU, it shall send a Transaction Acknowledgment PDU after
a random delay between 20 and 50 milliseconds."
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The Mesh specification recommends defaulting to the company ID in the
composition data when no other ID is relevant (e.g. in error cases or
if the app has not provided a callback).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Encrypting and sending a message takes a considerable amount of time
which makes the publication period longer than expected.
With this patch it is possible to pass MESH/SR/HM/CFS/BV-02-C test.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The branch for handling the case when the app has not provided a
callback for health faults was encoding the payload in a wrong way.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To avoid signedness issues with some compilers, like icx, use 'char *'
instead of 'unsigned char *' for the at_client buffer.
Fixes#3600
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The code was passing the wrong first parameter to the sdu_len_is_ok()
function.
Fixes#3985Fixes#3984
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The code was causing only one byte of data to be placed in timeout
instead of sizeof(timeout) as intended.
Coverity-CID: 170744
Fixes#4057
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The code was accessing wrong neighbor data when it received DAO
message. This corrupted nbr->iface pointer which was clearly seen
by "net nbr" shell command. The corruption then caused random
crashes or hangs when network interface via that pointer was
accessed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the ethernet packet destination MAC address is NULL when sending
IPv4 multicast or broadcast packet, then we must set it as otherwise
we might to access NULL pointer data.
Fixes#1544
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This adds a new state NET_IPV6_NBR_STATE_STATIC which never timeouts
which is required in case of RFC 7668 which doesn't allow publishing
the address:
https://tools.ietf.org/html/rfc7668#section-3.2.3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This wasn't working properly with CONFIG_APPLICATION_MEMORY enabled as
the sections weren't handled in the linker script.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
SoCs outside the Kinetis family can have the TRNG module, so move the
HAS_TRNG config from arch/arm/soc/nxp_kinetis to ext/hal/nxp/mcux
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
SoCs outside the Kinetis family can have the RNGA module, so move the
HAS_RNGA config from arch/arm/soc/nxp_kinetis to ext/hal/nxp/mcux
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
SoCs outside the Kinetis family can have the FTM module, so move the
HAS_FTM config from arch/arm/soc/nxp_kinetis to ext/hal/nxp/mcux
Note that 'select HAS_FTM' was previously missing from Kconfig.soc and
is now fixed.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
SoCs outside the Kinetis family can have the ADC16 module, so move the
HAS_ADC16 config from arch/arm/soc/nxp_kinetis to ext/hal/nxp/mcux
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>