Do not include the resource type (rt=) in the registration message when
using the OMA JSON format. This was a workaround specifically for the
Wakaama LwM2M server which is no longer needed since the latest master
branch.
Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
Portfolio object created string buffers for Identity resources
that was overlapping on some cases.
Don't calculate pointers by hand, allow compiler to calculate it.
Fixes#64634
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Extend the previous support of creating object instances by allowing
creation of resource instances as well.
Similarly, add support for deleting.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If user adds IPv6 address to the network interface, check
if the address is a multicast one and add it to multicast
group if it is.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If user adds IPv4 address to the network interface, check
if the address is a multicast one and add it to multicast
group if it is.
Fixes#64389
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Default behaviour should only bind to port independent of IP, this
allows even multicast/broadcast L4 traffic to be received.
User can always specify a specific address to bind using shell or
Kconfig or API.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Using a generic IP for address set failures is confusing, esp. two same
prints (one for v4 and the other for v6), so, use explicit version.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Moving the Zephyr specific config options from
modules/hostap/Kconfig to corresponding Kconfig where the
option is specified.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
CoAP reply structure user_data should be kept between
ongoing blocks, so that callbacks for LwM2M send continue
to work on blockwise transfers.
Fixes#64290
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The new "net sockets" command will utilize the object core
support to track and show information about BSD sockets that
are created in the system. This command is able to show info
for all network sockets (native, offloaded etc) in the system.
Example of the output of the new command:
uart:~$ net sockets
Creator Name Flags FD Lifetime (ms) Sent Received
main af_inet46 6ST 0 3260 819 498
main af_inet46 4ST 1 2110 469 142
main af_inet46 6DU 2 2110 9941 9941
main af_inet46 4DU 3 2110 1375 621
4 active sockets found.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The writefds is typically set if there is an error while
waiting for example the connect() to finish. So check if
the user supplied the writefds and update it accordingly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
In case ping is sent to own address, the request is looped back to the
stack and served before ping work had a chance to reschedule. In result,
when the final ping reply has been server, and ping operation finalized
with `ping_done()`, the work was rescheduled one last time, causing the
ping timeout to be reported. Fix this by rescheduling the work before
sending the actual request, so that the reply handler can cancel the
work properly in such case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The remote address of the connection is checked whether
it is v4-mapping-to-v6 address in which case we should
print it such.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This allows IPv4 and IPv6 share the same port space.
User can still control the behavior of the v4-mapping-to-v6
by using the IPV6_V6ONLY socket option at runtime.
Currently the IPv4 mapping to IPv6 is turned off by
default, and also the IPV6_V6ONLY is true by default which
means that IPv4 and IPv6 do not share the port space.
Only way to use v4-mapping-to-v6 is to enable the Kconfig
option and turn off the v6only socket option.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Fix two issues with net tcp command:
* The `net tcp` commands are still based on net_context API. For TCP,
the API caller (net shell) should add one extra reference to the
allocated net context, to prevent premature context release in case of
connection teardown. Currently that was not the case, and the context
was released too early, resulting in missing final ACK from the Zephyr
side on connection close.
* The net context API should not be called from the registered connect
callback, as this creates a temporary deadlock situation. The
net_context_connect() function blocks until the connection is
established, or an error or timeout occurs. For that time the
net_context mutex is being locked. In case of connection error (for
example after receiving RST packet) the connect callback is called,
indicating an error. If we try to call net_context API from within, a
deadlock situation takes place, as the context mutex is still locked
by the net_context_connect() (called from the shell thread). This
blocks the further execution of the TCP stack and can result in an
unexpected behavior (like for example retransmitting the SYN packet,
which takes place from yet another thread, TCP work queue).
Fix this, by releasing the net context not from the callback directly,
but based on the return value from net_context_connect().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The interface number is generated automatically if one
presses <tab> when expecting the interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow multiple commands use the same dynamic shell command
completion when expecting network interface index.
For example "net iface" and "net stats" are such commands.
The network interface expansion cannot be used in "net ipv6 add",
"net ipv4 add" and "net route" commands as they require more
data after the network interface index argument.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The "net stacks" has been obsolete for a long time already
so remove it for good. It is replaced by "kernel stacks" cmd.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>