This commit changes the Link-Layer Address Option length calculation
from hardcoded values to a numerical rounding up to full 8.
The length is calculated according to rfc4861 section 4.6.1.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
Allow Security level HIGH and FIPS to be initiated when we have received
OOB data for the remote device. The security property of MITM is allowed
if out of band authentication data is available.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Update bluetooth help text to include FIPS level in help text.
Also validate input range for the different connection types
Bluetooth security level for LE is from 1-4, while BR/EDR is 0-3
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
If the UDP socket is connected, then allow the user to leave
out the remote address in msghdr struct.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Authentication using OOB data uses the on-air device addresses used
during connection setup. So we need to check against the on-air
addresses in the info object to see if we have correct OOB data.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix issue with registering authentication callback handlers failing
without notifying the user of the shell.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Use the src and dst naming to refer to the identity addresses of the
connection. Keep the device addresses used during connections but rename
them to local and remote instead.
Update documentation to be more descriptive.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
- Commands were not gathered with the right macro
- bus fault access due to wrong declaration of iface_states external
variable.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The network to host byte order conversion is actually in place
on the network buffer. This prevents the reuse and forwarding of
RA packets. This commit uses temporary variables instead.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit adds support for a 6LoCAN Ethernet border translator.
CAN frames with the translator CAN address are translated and forwarded
to Ethernet. Ethernet frames with the first 34 bits matching the MAC
address of the translator are translated and forwarded to 6LoCAN.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
Take the targer link layer address option link laxer addres lenght
from net packets source addres instead if the interface.
This is usefull for 6LoCAN border translator (6LoCAN to Ethernet).
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit implements net_pkt_shallow_clone. A shallow clone clones
the net_pkt but not the buffers. The buffers are only referenced and
therefor only freed when both copies of the net_pkt are freed.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commits adds support for reception of packets thats comes from
a Ethernet to 6LoCAN translator. This packets carry the Ethernet
MAC address (6 bytes) inline in the FF (First Frame).
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit is an implementation of 6LoCAN, a 6Lo adaption layer for
Controller Area Networks. 6LoCAN is not yet standardised.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
Rename the socket_can implementation from CANBUS to CANBUS_RAW.
This is a preperation for 6LoCAN which is a CANBUS L2 for IPv6.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
subsys/bluetooth/host/Kconfig.gatt is already sourced within an
'if BT_CONN' in subsys/bluetooth/host/Kconfig.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix the mandatory and optional parameter counts for the
directed adv shell command definition. Also, refactor the
command for consistency.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
No need to write deletion entry for non-existing entry.
Furthermore such a write to filled up storage will make another
writes impossible as it occupied delete nvs_ate space, but it
does not remove anything.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
During initialization NVS analyzes open sector for
find write addresses. It was possible to infinite loop
in case when there was no space for any new ATE in the sector.
This patch introduce check for space available in the sector which
fix the issue.
fixes#17891
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
NVS always leave space for deletion ate in a full sector.
Even that it was not possible to write delete nvs_ate to the
full sector. Because of that it was possible to fill up NVS,
and be able to delete nothing.
This patch introduce recognition of case
the delete ate is writing, and allow to write such nvs_ate to
opened full sector.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
If sendmsg() is used for TCP sockets, the msghdr->msg_name is not
really used as the socket must already have been connected.
In that case just get the destination address directly from
net_context remote address field.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix assert in the RPA timeout when no resolving entry exists in the
resolving list, and the advertiser was requested to use a local IRK
to generate it's own address.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
If no callback for oob data request is registered, or the user decided
to abort authentication during OOB data request, we should return the
error code for no OOB data available to indicate that the user does not
have the correct OOB, or no OOB interface at all.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix kernel crash if bluetooth authentication handlers has not been
registered. The bt_auth object is then NULL, this dereference caused a
call to an invalid function pointer.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Previous ATE searching is accelerate by reading sector
close ate, which allow to skip reading whole storage.
ATE is already covered by crc8. That patch introduce
check on correctness offset read form close ate. This
increases meta-data integrity check level.
This also preserves against possible looping when read
incorrect or not a NVS storage image.
fixes#16899
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The code was already rejecting the key, however that rejection
happened only after we had already sent our public key as response,
which got interpreted as acceptance by the tester (PTS).
This fixes issue that d4fd267086
supposed to fix. The problem is bt_dh_key_gen is async.
Local public key cannot be sent from the same context
the bt_dh_key_gen is called because we don't know yet
if remote key is valid.
Fixes MESH/NODE/PROV/BI-13-C.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Fixed error 'The int symbol BT_DISCARDABLE_BUF_COUNT is being evaluated
in a logical context somewhere'.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
subsys/bluetooth/host/Kconfig.l2cap is already sourced within an
'if BT_CONN' in subsys/bluetooth/host/Kconfig, so BT_DEBUG_L2CAP does
not need a 'depends on BT_CONN'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Find by type does only accept a UUID with the same length as the UUID
which is stored in the internal list. If a UUID is stored in the short
16 bit format then a request with 128 bit UUID will fail.
Add support for the missing formats.
Signed-off-by: Kim Sekkelund <ksek@oticon.com>
Changed ticker behavior to resolve conflicts in ticker_worker instead of
in ticker_job. This allows better real-time slot allocation, as well as
allowing callbacks even if ticker node doesn't get air-time (for audio
stream housekeeping). A priority property now also allows prioritizing
one ticker node over others.
Compatibility mode enables lagacy ticker behavior if needed.
Signed-off-by: Morten Priess <mtpr@oticon.com>
DISK_SDHC_VOLUME_NAME is already defined within an 'if DISK_ACCESS_SDHC'
block, so the 'depends on DISK_ACCESS' is redundant.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix an issue in the SMP identity distribution where the IRK for the
default identity was always distributed.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
There's desire to be able to customize parameters on a per-filesystem
basis, which means we need a way to override the Kconfig defaults which
are global. This also means the littlefs data structure cannot own the
cache and lookahead buffers.
Switch to using a macro to define the littlefs data structure. The
default version uses the Kconfig constants. A custom one takes
arguments providing the most likely partition-specific parameters.
Finally the user is free to bypass the helper macros and set any
parameters desired, though validation is limited and only present when
CONFIG_DEBUG is enabled.
Extend the test suite with a performance module, which confirms that
these settings have an impact proportional to the log of changes to the
cache or IO sizes.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Existing file system implementations do not provide the special "."
(current) and ".." (parent) directory entries in the readdir results.
littlefs does.
Remove these entries in the abstraction layer. This simplifies code in
higher level consumers that aren't prepared to see them. Consumers like
FUSE that need them can put them back without having to worry about
conflicts.
Closes issue #17951
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The previous way of creating an absolute path relied on snprintf(), and
when used with newlib gcc warned that the output could be truncated
before the last format character. Rework to use code that doesn't rely
on snprintf.
See discussion at https://bugzilla.redhat.com/show_bug.cgi?id=1431678
Also ensure that cwd is always NUL-terminated, and use the utility
function to create the absolute path in cmd_trunc.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Add support for the littlefs file system in the fs shell. Update
the sample to use the same partition configuration as the littlefs
example for the SPI NOR test platform.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
littlefs is a fail-safe filesystem from ARM Mbed that has wear-leveling
capabilities.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Jim Paris <jim@bolt.io>
Before calling socket callback function, make sure the callback
function exists so that we do not get NULL pointer reference.
Fixes#18021
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix an issue with enhanced connection complete event raised by the
advertiser role. The advertiser reported that it has resolved the
the identity address of the peer, even when the peer is connecting
using it's identity address.
The host will not have the correct on-air address type i.e public.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix bug introduced by: 45da629b24
Mistakenly set the own address type to the destination address type.
Also this uses the RPA_OR_RANDOM in case local IRKs exists in the
controller.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This is related to findings in #17997 and changes network related
header files to have include files outside of extern "C" { } block.
Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.
Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.
See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The 'registered' flag was not cleared when 'gatt metrics off'
was called so that one was unable to register the service again.
Remove 'registered' variable that is actually not needed as there
is no tracking if service is already registered in similar
cmd_register_test_svc command. If the service is already registered,
the host will log an error.
Fixes: #17882
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The sector size is 0 will pass "fs->sector_size % info.size" then start
a loop in nvs_startup() and never return. So retrun an error if the
sector size is 0.
Signed-off-by: Harry Jiang <explora26@gmail.com>