Added additonal checks in net_ipv6_input to ensure that multicasts
are only passed to the upper layer if the originating interface
actually joined the destination multicast group.
Signed-off-by: Philip Serbin <philip.serbin@lemonbeat.com>
In case when SMP has been enabled, the shell_thread would be signaled
even if no data has been read from fifo.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
In case when shell ring buffer gets full the data may still be taken
from the UART fifo, byte by byte, and accepted by the SMP back-end,
if the back-end has been enabled.
Unfortunately the uart_rx_handle failed to check if it has been
successfull in reading a byte from the fifo, before passing it to
the SMP for processing, which could lead to processing random stack data
as a part of an SMP frame.
Additinally, when the SMP would have accepted the byte,
the uart_rx_handle would fail to signal shell_thread, that the SMP has
internally buffered data that could be processed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Sort entries alphabetically and cleanup top level menu for each
subsystem. Move stats subsystem Kconfig from debug into its own Kconfig.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This one was appearing in the top level Kconfig menu when viewed in
menuconfig. Move it to where it belongs.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Elevate connections always to security mode 1 level 4 when
Secure Connections Only Mode has been enabled in the Security Manager.
Elevate connections always to security mode 1 level 3 when
Legacy pairing with OOB only has been enabled in the Security Manager.
Fixes: #27338
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Now that TCP2 is the default stack, make the shell compatible
with both stacks.
Note: net_tcp_foreach is not implemented in TCP2, so related
code depends on TCP1.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
PPP Phase Diagram [1] allows only one way phase change. In current
implementation there is an additional RUNNING phase, which is entered
just after NETWORK phase.
Prevent going back from RUNNING to NETWORK phase when Term-Req was
received, as this is meaningless for overall PPP operation and violates
PPP Phase Diagram property of having one way direction change.
This change also improves Adminitrative Close handling (calling
lcp_close()). This request results in moving into TERMINATE phase. Then
LCP is put down (by calling lcp_down()) and then ppp_link_down() is
called, which so far (before this patch) resulted in moving back to
NETWORK and then to DEAD. Right now (after this patch) we move directly
from TERMINATE to DEAD phase, which is exactly how [1] specifies it.
[1] https://tools.ietf.org/html/rfc1661#section-3.2
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
State Transition Table [1] specifies that Administrative Close should
result in CLOSING state. This is not respected in case of LCP, as
STOPPED state was forced in lcp_close().
Don't force going into STOPPED state in lcp_close() and rely on
ppp_fsm_close() to move to CLOSING state instead.
This patch fixes overall Adminitrative Close procedure and allows to
move back into fully operating PPP connection once again after
Adminitrative Open.
[1] https://tools.ietf.org/html/rfc1661#section-4.1
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
LOG_BACKEND_SPINEL_LEVEL turned out to be useless and was removed.
Also changes to keep coherence between Zephyr log level and OT log
level added by otPlatLog() were introduced.
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Many functions signal success by returning a return code of zero. Add
an assertion for this.
Some functions can return a positive value to indicate success, where
they want to convey some information. This is not handled by this
assert function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Print role information next to port information. Also make
sure that port number is set correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Save some memory and separate common string snippets from larger
strings. In this case "does not match" sub-string is printed by
several warning prints so separate the sub-string from the bigger
string.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Return BT_HCI_ERR_INVALID_CONN_ID if an invalid handle is
given by the HCI; currently sometimes BT_HCI_ERR_CMD_DISALLOWED
is returned
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
So far SMP shell transport was initialized in APPLICATION run level, but
shell over UART was initialized in POST_KERNEL. This could end up in
situation when received frames were scheduled for further processing in
SMP layer, when it was not initialized yet.
Export smp_shell_init() function declaration and call it before shell is
initialized with all its receive data handlers. This prevents situation
when data is scheduled for processing in SMP layer, when that one is not
ready yet.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
net: route: Add prefix-based ipv6 multicast forwarding
This adds/reenables the feature of multicast routing/forwarding.
The forwarding decision is based on the added multicast routes
and the new network interface flag:
NET_IF_FORWARD_MULTICASTS.
Signed-off-by: Jan Georgi <jan.georgi@lemonbeat.com>
This commit fixes an issue when more than one USB transfer is
reserved for same OUT endpoint.
There are 2 scenarios when this could happen:
- The Host sends SET_CONFIGURATION(1) request twice.
- The Host triggers Suspend->Resume->Configured
event sequence for the device.
USB tranfers are not canceled on SUSPEND event
when the device was not configred previously.
Because of that USB transfer slot is reserved twice
for the same OUT endpoint and lead to shortage of USB
transfer slots quickly.
Without this patch CDC ACM class reserves duplicated USB
transfer slots for one transfer. The sequence of
Suspend->Resume events is genereted alongside with
Configured and the stack will shortly run out of transfer
slots.
If the Host, for some reason, decides to send
SET_CONFIGURATION request twice the same issue is seen.
This patch prevents from reserving additional USB transfer
slots twice.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This patch implements optional authentication phase, which is done
between link establishment and network phases. It is part of LCP option
negotiation to decide whether authentication is needed and which
protocol will be used. For now we add only PAP support and try to
negotiate it when some other protocol (e.g. CHAP or EAP) is proposed
earlier. For simplicity reason we only add one way authentication
support, which means that we try to authenticate to the other peer, but
do not require authentication from it.
This is an important step to make PPP work with cellular network modems,
because most of them require to provide username and password within PPP
authentication phase. Those credentials are used by modem to login to
cellular network. In most cases however it is enough to provide dummy
values, because they are not verified. For this reason and simplicity of
this patch we hardcode PAP Peer-ID and Password now.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This module had only some header includes, without actual code. Remove
it, as it is better to create one module per authentication protocol
anyway.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Add enums of PAP, CHAP and EAP authentication protocols. Also add their
string representations, so they will nicely show up in logs during
debugging.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Interpret -EINVAL return value from options' parse() callback as "option
value is not supported". After receiving such value nack() callback will
be executed in order to put supported value in the response.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Shell will display a warning message if there was a request to print
a message on the not initialized shell backend.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
Disable shell print functions if the shell is not initialized.
Update tests accordingly.
Fixes#27161
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
Given the comment in `ipv6_event_handler`, the init function shall wait
for the last added IPv6 address to be confirmed with DAD. This is
contrary with current logic, which will only wait for the first address
to be confirmed.
This commit adds a break statement in the loop, not to overwrite the
recent address to verify with an older one.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Removed the check for selected_per_adv_sync as it was unused by the
create/delete functions (which take the index as parameters), and
caused the shell not to print any values.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
The `free_per_adv_sync` pointer in `cmd_per_adv_sync_create`
did not work as intended, as it didn't actually update the
pointer in the array, which caused the
`cmd_per_adv_sync_delete` to not function as intended.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
In the function do_net_init() the paths for ipv6 and ipv4 now use the
same api to determine the source address.
Fixes#27428
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
When verifying the parameters check NULL value separately.
This will avoid nasty warning message to be printed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add function pointer to vtable and use that directly instead of
routing via ioctl() call. This is done as we are trying to get
rid of ioctl() calls in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Do not route close() calls via ioctl() as that is error prone
and quite pointless. Instead create a callback for close() in
fdtable and use it directly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_BT_EXT_ADV was enabled but
CONFIG_BT_EXT_ADV_LEGACY_SUPPORT was disabled and
CONFIG_NO_OPTIMIZATIONS was enabled, then there was a
maybe-initialized warning. Fixed by adding additional
checks.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of casting struct in6_addr, sin6_addr member is now used
directly, like in every other instance of calling net_ipv6_is_prefix().
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Core 5.2, Vol 4, Part E, section 5.3.1 clarifies that advertising set
handle is assigned by host when advertising set is created and this
happens only on LE Set Extended Advertising Parameters.
An advertising set handle is an arbitrary number within allowed range,
i.e. 0x00-0xEF and not 0..max_supported-1.
This patch adds option to enable advertising set handle mapping from
HCI range as defined by Core specification to zero-based handles used
by LL. If enabled, HCI handle will be remapped to LL handle for each
command, otherwise HCI handle will be used as an LL handle. The latter
effectively skips mapping logic and should be used with Zephyr host
which uses zero based indexes.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>