Drop snprintf() and use snprintk() as snprintk()
is more suitable for the networking code.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
NET_BUF_ASSERT() tranlates into nothing in presence
of CONFIG_ASSERT=y, which is misleading.
Use __ASSERT() in NET_BUF_ASSERT().
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
No packet was previously sent, because net_pkt_set_ppp(pkt, true) was
not called on the outgoing packet. Also the received protocol instead of
LCP was used, which was incorrectly interpreted by remote peer.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Received net_pkt is always discarded in ppp_recv() if we return
NET_OK. Don't do this in ppp_fsm_recv_discard_req().
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
When iterating though configuration options it is possible that we will
fail to add data to nack_buf and hence unref it in error handling
path. Just after that we will unref buf, which has nack_buf in its
buffer chain.
Drop code unrefing nack_buf and just go directly to unrefing buf.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
There is no possibility right now that 'nack == NULL' and 'nack_buf !=
NULL', so drop code path for that case.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
If we can write to the socket in POLLOUT, then there is no need to
wait.
Note that this is not a full POLLOUT implementation but prevents
the code from waiting even if we could send data out.
Fixes#18867
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Same deal as in commit 41713244b3 ("kconfig: Remove '# Hidden' comments
on promptless symbols"). I forgot to do a case-insensitive search.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Make the channel ops struct const since there really isn't anything
there that needs to change at runtime. The only exception is the L2CAP
shell which was playing with the recv callback, however that can be
fixed by introducing a simple bool variable.
With tests/bluetooth/shell this reduces RAM consumption by 112 bytes
while adding only 16 bytes to flash consumption.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Maintain a simple count of how many PINGREQ have been sent for the
current connection that have not had a corresponding PINGRESP. Nothing
is done with this information internal to the MQTT driver, but it is
exposed to the application layer to monitor as desired.
Signed-off-by: Justin Brzozoski <justin.brzozoski@signal-fire.com>
The commit 8892406c1d ("kernel/sys_clock.h: Deprecate and convert
uses of old conversions") changed code to not use deprecated macro.
Unfortunately there was some changes done to RX TC stats update that
were missing from that commit. This commit fixes the issue and removes
the last user of the deprecated SYS_CLOCK_HW_CYCLES_TO_NS64() macro.
This is follow up to commit 5bbdf56769 ("net: stats: Fix RX time
statistics update") which failed to remove all users of the deprecated
macro.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Based on work by Michael Scott.
Add a new Kconfig knob, CONFIG_LWM2M_IPSO_TIMESTAMP_EXTENSIONS. This
defaults to n. When enabled, various IPSO objects will by default have
the timestamp resource (5518) added to their representations. This can
be turned off on a per-object basis.
The idea of adding timestamp resources was originally suggested by
Hannes Tschofenig on this OMA page:
https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/429
Signed-off-by: Michael Scott <mike@foundries.io>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The commit 8892406c1d ("kernel/sys_clock.h: Deprecate and convert
uses of old conversions") changed code to not use deprecated macro.
Unfortunately there was some changes done to RX stats update that were
missing from that commit. This commit fixes the issue and removes use
of the deprecated SYS_CLOCK_HW_CYCLES_TO_NS64() macro.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Follwing the convention in Zephyr, all CMake configuration related to
a module, should be placed within the module repostiory.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Timestamp and RecordRoute options are supported
in only ICMPv4 EchoRequest call as per
RFC 1122 3.2.2.6.
Fixes#14668
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
IPv4 header options length will be stored in ipv4_opts_len
in net_pkt structure. Now IPv4 header length will be in
net_pkt ip_hdr_len + ipv4_opts_len. So modified relevant
places of ip header length calculation for IPv4.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
OpenThread recently introduced CMake build system into its repostiory
so we no longer need autotools to build OpenThread libraries and can
integrate them natively.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The TCP code expects that we know when the socket has called accept()
in order to continue connection attempt.
Fixes#21335
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Packets shall never fail to be sent now that they are queued, so if an
error occured there is no point in keep the channel connected.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Functions like `setup_ipv4` or `setup_ipv6` might already use the
`counter` semaphore, therefore it should be initialized before these
functions are called.
As a result of this issue, the network stack could stall until timeout
under certain circumstances (e.g. when OpenThread was used).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
An expired IPv6 router would cause an infinite loop where
iface_router_run_timer() repeatedly scheduled a work item. In some
conditions it would schedule with negative delay, in other conditions
the infinite loop wouldn't happen until a router was added again.
Get rid of the router from active_router_timers when it is removed.
Fixes#21339
Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
Without this fix is it not possible to terminate pppd and restart
pppd afterwards without restarting the firmware, too.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Without this fix is it not possible to terminate pppd and restart
pppd afterwards without restarting the firmware, too.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.
Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.
Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This adds net_bug_simple_init_with_data which can be used to initialize
a net_buf_simple pointer with an external data pointer.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Before we try to set IP addresses to the network interface,
make sure that the interface is up.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>