If the timer at the head of a ztimer clock's timer list is re-scheduled
(ztimer_set() called on an already set timer) and the timer is no longer
at the head after being re-scheduled, clock-ops->set() is never called
from inside ztimer_set(), and the underlying timer is left with an ISR
scheduled to expire at the timer's old time. The intended behavior is
that the clock's lower level timer should always be set to expire at the
time of the clocks head timer.
This patch changes ztimer_set() to call _ztimer_update(), which sets the
lower level timer according to the current list of timers, rather than
setting the timer directly inside of ztimer_set().
Some calls to `coap_build_hdr()` were done with the target buffer for
the header and the source buffer for the token overlapping:
They reuse the buffer that held the request to assemble the response in.
We cannot use `memcpy()` in this case to copy the token into the target
buffer, as source and destination would (fully) overlap.
This commit makes reusing the request buffer for the response a special
case: `memcpy()` is only used to copy the token if source and
destination address of the token differ.
An alternative fix would have been to use `memmove()` unconditionally.
But `memmove()` does not make any assumption about the layout of target
and source buffer, while we know that the token either will already be
at the right position (when reusing the request buffer for the response)
or be in a non-overlapping buffer (when generating a fresh token). This
approach is more efficient than `memmove()`.
This adds a clang-format configuration based on the Linux Kernel
configuration and modified to better match RIOT's coding convention.
Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
This patch replaces the package supplied logging macros with RIOT's. It
also removes the requirement that DEVELHELP be defined to enable
logging. Instead, logging can be enabled/dissabled via the log level.
This patch replaces the package supplied logging macros with RIOT's. It
also removes the requirement that DEVELHELP be defined to enable
logging. Instead, logging can be enabled/dissabled via the log level.
The patch also replaceses the package's trace macro with RIOT's DEBUG
macro.
This adds enough to do compile testing for gcoap_forward_proxy.
A proper test would still be needed, though.
This still already exposed compilation issues.