Commit e99b5228a1 changed the default
networking behavior on qemu platforms, as the SLIP_TAP driver no longer
selected Ethernet L2. In results, qemu platforms in default
configuration had no network interface to work with.
Fix this, by restoring select for NET_L2_ETHERNET, but this time in
NET_SLIP_TAP. The difference is that SLIP_TAP is a generic driver
config, which could be enabled on any platform, so not changing the
behavior here, while NET_SLIP_TAP is a config dedicated for qemu only,
so it's reasonable to enable all that's needed to get SLIP to work with
qemu by default.
As there were circular Kconfig dependencies, move the respective qemu
configs outside of NET_RAW_MODE if block (as this caused the circular
dependency with ETH_DRIVER_RAW_MODE). Also, remove dependency to
NET_L2_BT, as it made little sense there, and also caused dependency
problems.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
There is no limitations for dwell time. Just add
valid condition for positive value. So , it's better
to remove those constraints.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Running out of connection contexts is most likely due to app
misconfiguration, therefore it's useful to get an explicit information
that context allocation failed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Correct various small edge-case behaviors that have been accidentally
introduced in the http_client.
- http_client_req no longer incorrectly returns -ETIMEDOUT on NULL HTTP
resonse. -ETIMEDOUT is now only returned when the underlying TLS
socket times out.
- http_client_req now returns -ECONRESET upon incomplete (but non-NULL)
HTTP response. The request callback is no longer called in this case
(as with any other error state).
- http_wait_data has been refactored slightly to increase clarity.
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
If the packet cloning fails (can easily happen when working with
loopback interface and when having low net_buf count), then
print a warning to the user. Error could also be possible but
as the situation might correct itself in this case, the warning
should be enough.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If we fail to join all nodes or solicit node multicast groups
when the interface is down, then there is no need to print an
error message. The groups are automatically re-joined when the
interface comes up.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If user created the capture device using the API and not via
the shell, then the device name was not set. Use the default
capture device in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The event NET_EVENT_CAPTURE_STARTED is generated when the
capture is enabled, and NET_EVENT_CAPTURE_STOPPED when capture
is disabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The net_capture_pkt() does not return information what happened
to the net_pkt because the packet was always cloned. With cooked
capture we can avoid the cloning in which case we need to know
the capture status in order to unref the packet if needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for capturing arbitrary data via the cooked mode (sll)
capture API. The actual packet capture is done using net_capture_data()
function, the packet capture infrastructure does not need any changes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to create a kitchen sink pseudo a.k.a any network
interface that one is only able to write to. This might seem
unnecessary, but it is possible to attach virtual network
interfaces on top of this pseudo interface. These virtual
interfaces could then process the data for example for
packet capture purposes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
For debugging purposes it would be nice to see the verdict
printed as a string instead of number.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add a recv callback to dummy API. After this it is possible to
receive data by a dummy network interface. This is only useful
if one attaches a virtual interface on top of the dummy one.
One such example is the cooked mode capture interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit fixes an issue where due to inverted logic (static function
returned 0 on success but the caller expected true/false) the MLDv2
reports were silently dropped.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
Deprecate CONFIG_NET_TCP_ACK_TIMEOUT as it is redundant with the
combination of CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT and
CONFIG_NET_TCP_RETRY_COUNT. The total retransmission timeout (i. e.
waiting for ACK) should depend on the individual retransmission timeout
and retry count, having separate config is simply ambiguous and
confusing for users.
Moreover, the config was currently only used during TCP handshake, and
for that purpose we could use the very same timeout that is used for the
FIN timeout. Therefore, repurpose the fin_timeout_ms to be a generic,
maximum timeout at the TCP stack.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add hostname changed printout to event monitor. As the name
says, it is generated when the hostname of the device changes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Starting with b1d24e425c (net: lwm2m:
device object: optionally store error list in settings), it was no
longer possible to build the code with coverage enabled when the
settings subsystem was disabled.
The build would fail with an error like this:
> subsys/net/lib/lwm2m/lwm2m_obj_device.c:262: undefined reference to
> `settings_name_steq'
This fixes#70923.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
According to the `RFC8415` the length of the DUID is at least 1 octet
up to 128 octets. Now a user can choose buffer length without the need
for source code modification.
Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
eth_stats.h is using ethernet api but not including the header,
it must be working by luck in files that include it after
something else that includes ethernet.h, fix by just including it.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Instead of having a single config specifying the memory pool size for
variable-sized net buffers, have a separate one for TX and RX for better
configuration granularity when optimizing memory usage of the
application.
Deprecate the old configuration but use its value as a default (for now)
for the new configs. This will need to change when the config is
deleted.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
There should be a particular defines which clarify the
use of that number. So, replacing numbers with defines
in wifi shell.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Outgoing block-transfers now set the socket hint
to ONGOING as long as the BLOCK1/BLOCK2 header has
MORE flag set to true.
This means as only the last packet in the block-transfer
set the socket hint to LAST or ONE_RESPONSE.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Once Wi-Fi is associated few parameters like listen interval and
power-save mode cannot be changed. The state for association is
"ASSOCIATED" and not completed. Even after state transitions to
COMPLETE, it can still go back to other states, e.g., PTK/GTK renewal.
Fix the state check.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The gPTP is not suppose to be run on top of VLAN and the
earlier support was just for testing purposes. Remove VLAN
support now after the VLAN overhaul.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print also network interface index together with the pointer value
in order to get more useful information what is going on in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print information whether a multicast address is properly
joined to a multicast group when print addresses using
"net iface" command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
As the interface type is always Virtual, no need to print it.
Print instead the name of the network interface as it is more
useful to the user.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If an IPv6 address was added to the interface while the
interface was down, its solicited node multicast address
is not joined properly and IPv6 communication will to
other hosts will fail. So make sure to rejoin all the
solicited node multicast groups that were joined already
when the network inteface is going up.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add debug information to print when the network L2 enable
callback is called and fails. Useful to see this information
as at that point the interface goes down.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Start any pending IPv6 DAD timers when interface comes up.
If IPv6 addresses have been added to the network interface when
it was down, the addresses would never work properly if the DAD
is not done.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of printing just a network interface pointer, print
also the interface index so debugging is a bit faster as no
lookup from interface listing is needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
No need to do the checks any more because user has specified
the VLAN count and so many VLAN virtual interface are already
created.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Re-implement the VLAN support inside the network stack.
All the user facing APIs stay as is but internally the VLANs
are implemented using the L2 virtual interfaces.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Some compilers have trouble parsing variables directly after a case
statement.
Fixes: #70792
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Changing remaining users of fcntl.h to use the include from our own
POSIX file so that the values in there are consistent in all parts
of the sources.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use only Zephyr specific POSIX header files so that the whole
system is getting values from the same files. There was an issue with
native_sim run of tests/net/socket/af_packet which had O_BLOCKING set
to 0x4000 from include/zephyr/posix/fcntl.h, but then the file
subsys/net/lib/socket/sockets.c was having O_BLOCKING set to 0x0800
because different header files were used.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Currently the socks library does not use sockets so there
is no need to select socket symbols.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The library should be using internal socket API functions
so that we do not need to depend on POSIX_API inside the
network stack.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Have special wrappers for zsock_fcntl and zsock_ioctl functions
so that gcc warning can be avoided.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The CONFIG_NET_SOCKETS_POSIX_NAMES option is marked as deprecated in
favor of using normal POSIX socket API includes found under the
include/zephyr/posix directory. If you want to use BSD socket API calls,
you need to select POSIX_API and use the socket headers found in the
POSIX subsystem. If you do not want to or cannot enable POSIX_API,
then you must use zsock_ prefix when working with BSD socket calls.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>