1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

11237 Commits

Author SHA1 Message Date
Marian Buschsieweke
2b6f65a08a
build_system/xfa: change API to fix alignment
This changes the API of xfa from

    XFA(array_name, prio) type element_name = INITIALIZER;

to

    XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on `native64`.
2024-11-07 16:30:01 +01:00
Marian Buschsieweke
d10ab413a0
Merge pull request #20952 from benpicco/nanocoap-block_robust
nanocoap/sock: re-try if wrong block was received
2024-11-05 17:24:17 +00:00
Benjamin Valentin
9b25c033de nanocoap/sock: re-try if wrong block was received 2024-11-05 18:06:31 +01:00
Marian Buschsieweke
c70075b073
Merge pull request #20950 from maribu/sys/net/nanocoap/coap_get_response_hdr_len
sys/net/nanocoap: add and use coap_get_response_hdr_len()
2024-11-05 13:09:51 +00:00
Marian Buschsieweke
68beb52f14
sys/net/nanocoap: add and use coap_get_response_hdr_len()
Before, handlers writing blockwise transfer assumed that the response
header length will match the request header length. This is true for
UDP, but not for TCP: The CoAP over TCP header contains a Len field,
that gets extended for larger messages. Since the reply often is indeed
larger than the request, this is indeed often the case for CoAP over
TCP.

Note: Right now, no CoAP over TCP implementation is upstream. However,
      getting rid of incorrect assumptions now will make life easier
      later on.
2024-11-05 10:46:02 +01:00
Marian Buschsieweke
2c93dc9c3b
sys/net/nanocoap: fix coap_build_reply_header()
In case no payload is added, `coap_build_reply_header()` would return
`sizeof(coap_hdr_t) + token_length` regardless of the actual header
length returned by `coap_build_hdr()`. These can be different if
RFC 8974 extended tokens are enabled (module `nanocoap_token_ext`
used): If an extended token length field is used, its size is not
considered.

Co-authored-by: benpicco <benpicco@googlemail.com>
2024-11-04 21:18:07 +01:00
Marian Buschsieweke
469edf4827
sys/net/nanocoap: fix coap_get_total_hdr_len()
Before `coap_get_total_hdr_len()` did not take the extended TKL field
(RFC 8974) into account. This fixes the issue.
2024-11-01 13:58:34 +01:00
mguetschow
00e25adfe3
Merge pull request #20720 from netd-tud/chacha20-glue-code-implementation
sys/psa_crypto: one-shot Chacha20 support
2024-10-29 16:52:30 +00:00
benpicco
1fc9d1bb82
Merge pull request #20934 from LasseRosenow/pthread-attr-setstack
sys/posix/pthread: Add pthread_attr_getstack and pthread_attr_setstack
2024-10-29 16:17:51 +00:00
Lasse Rosenow
459b8dc6aa
sys/posix/pthread: Add pthread_attr_getstack and pthread_attr_setstack 2024-10-29 13:29:54 +00:00
Marian Buschsieweke
02e059546f
Merge pull request #20944 from maribu/sys/usbus/stable-ids
sys/usb: Use luid_base for stable USB serials
2024-10-29 09:10:31 +00:00
Marian Buschsieweke
6b80a1a61e
sys/usb: Use luid_base for stable USB serials
This is useful when having multiple instances of the same board
connected via USB CDC ACM and telling the TTYs apart.
2024-10-29 09:40:22 +01:00
Marian Buschsieweke
49c151e432
sys/luid: luid_custom() use fixed width int
This changes the type of the last parameter of `luid_custom()` to a
fixed width integer for consistent behavior among different
architectures.
2024-10-28 14:51:44 +01:00
Teufelchen
b376bec667
Merge pull request #20847 from benpicco/event_assert
sys/event: add assertion that event has a handler
2024-10-25 08:11:51 +00:00
Marian Buschsieweke
ba83fefe3b
Merge pull request #20936 from maribu/drivers/periph_gpio/gpio_read/bool
drivers/periph_gpio: let gpio_read() return bool
2024-10-24 20:43:55 +00:00
benpicco
ae36fa4b37
Merge pull request #20921 from Vjorald/cord-doc
sys/net/app/cord: update doc
2024-10-24 16:59:01 +00:00
mguetschow
fbde0209d1
Merge pull request #20933 from benpicco/sys/net/application_layer/gcoap-ipv4
gcoap: fix build with IPv4
2024-10-24 09:28:23 +00:00
Marian Buschsieweke
7d1313b3bf
treewide: update rust-riot-wrappers 2024-10-24 09:57:36 +02:00
benpicco
87c825dd82
Merge pull request #20915 from fabian18/pr/gcoap_forward_proxy_timeout
gcoap/forward_proxy: handle timeout case
2024-10-23 21:58:57 +00:00
Benjamin Valentin
ce6d753aa1 gcoap: fix build with IPv4 2024-10-22 14:04:20 +02:00
benpicco
c48247f984
Merge pull request #20916 from derMihai/mir/event_sync_mainline
sys/event: add event_sync()
2024-10-21 09:55:56 +00:00
Vjorald
d2600f8eff cord/doc: Remove the label (Not Yet Implemented) and the group part
Co-authored-by: chrysn <chrysn@fsfe.org>
2024-10-18 23:55:07 +02:00
Vjorald
d4fb64cfbc cord/doc: Update references to RFC 9176 2024-10-18 23:52:35 +02:00
Joshua DeWeese
45942f6821 sys/ztimer: fix re-scheduling of timers
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().
2024-10-18 14:52:11 -04:00
Mihai Renea
9996909b65 sys/event: add event_sync() 2024-10-18 13:14:04 +02:00
benpicco
ed9c6a2e47
Merge pull request #20919 from chrysn-pull-requests/rust-updates
treewide: Update Rust dependencies
2024-10-18 09:36:21 +00:00
benpicco
bada659375
Merge pull request #20918 from maribu/sys/net/nanocoap/coap_pkt_set_code
sys/nanocoap: add coap_pkt_set_code()
2024-10-17 16:02:19 +00:00
chrysn
bb3520fff0 treewide: Update Rust dependencies 2024-10-17 16:20:26 +02:00
Marian Buschsieweke
f16875b6ec
sys/nanocoap: add coap_pkt_set_code()
This adds a small convenience function to set the CoAP code of a packet
and converts users of coap_hdr_set_code() where applicable.
2024-10-17 14:56:54 +02:00
Marian Buschsieweke
835571c0a7
sys/net/nanocoap: fix UB when building hdr
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()`.
2024-10-17 14:02:06 +02:00
Wunderbaeumchen
b9396c4739 sys/psa_crypto: chacha20 oneshot gluecode 2024-10-17 10:25:59 +02:00
Fabian Hüßler
224fdb2294 gcoap/farward_proxy: handle timeout case 2024-10-16 16:10:28 +02:00
benpicco
3706589959
Merge pull request #20834 from derMihai/mir/nib/drop_for_unreachable_rebase
gnrc/ipv6/nib: don't queue packets on 6lo neighbors and drop/flush if…
2024-10-16 09:16:40 +00:00
Mihai Renea
3a5612ee57 gnrc/ipv6/nib: don't queue packets on 6lo neighbors and drop/flush if UNREACHABLE 2024-10-16 09:01:36 +02:00
benpicco
9123b5e8c6
Merge pull request #20911 from fabian18/pr/event_periodic_no_delay
sys/event: add API to start periodic event without initial delay
2024-10-15 22:13:00 +00:00
Fabian Hüßler
90473c62f0 sys/event: add event_periodic_start_now() 2024-10-14 21:17:38 +02:00
Fabian Hüßler
2b682585a7 sys/ztimer: add ztimer_periodic_start_now() 2024-10-14 21:15:50 +02:00
Marian Buschsieweke
71b91a1d0e
sys/net/gcoap_forward_proxy: fix compilation issues 2024-10-14 14:30:20 +02:00
Marian Buschsieweke
54f4cd7cd1
sys/matstat: fix compilation with newlib
newlib (nano) does not support 64 bit types (neither in stdio nor with
corresponding `PRI*64` macros). With GCC 13.2.1 (as shipped in Ubuntu
24.04.1 LTS), this triggers the following compilation error (even with
`ENABLE_DEBUG == 0`):

    sys/matstat/matstat.c:57:21: error: expected ')' before 'PRIu64'
       57 |     DEBUG("Var: (%" PRIu64 " / (%" PRId32 " - 1)) = %" PRIu64 "\n",
          |                     ^~~~~~

This fixes the issue by falling back to printing 32 bit values when
the `PRIu64` macro is not defined. A `!trunc` is appended when the
64 bit exceeds the range of [0:UINT32_MAX].
2024-10-09 22:23:40 +02:00
Mikolai Gütschow
f0e6776d40
treewide: apply codespell corrections 2024-10-09 13:03:52 +02:00
mguetschow
a54ba26285
Merge pull request #20893 from benpicco/THREAD_CREATE_STACKTEST-cleanup
treewide: clean up remnants of THREAD_CREATE_STACKTEST
2024-10-08 09:55:52 +00:00
Benjamin Valentin
97128eef48 treewide: clean up remnants of THREAD_CREATE_STACKTEST 2024-10-07 17:31:31 +02:00
chrysn
13188e13f2
Merge pull request #20887 from chrysn-pull-requests/fmt
static_tests: Add test for Rust code formatting rules
2024-10-04 08:24:07 +00:00
benpicco
248371e11a
Merge pull request #20881 from Teufelchen1/fix/rpble
bluetil: Ensure advertisement length does not exceed pkt len
2024-10-03 12:50:32 +00:00
benpicco
8a933a56ae
Merge pull request #20882 from Teufelchen1/fix/dhcpv6
net/dhcpv6: Improve option parsing in dhcpv6 advertise
2024-10-03 12:50:12 +00:00
chrysn
69a89b80ca treewide/rust: cargo fmt 2024-10-02 22:17:08 +02:00
Teufelchen1
f88285de75 net/dhcpv6: Improve option parsing in dhcpv6 advertise 2024-10-02 09:47:22 +02:00
Teufelchen1
84f1ae3635 bluetil: Ensure advertisement length does not exceed pkt len 2024-10-01 14:49:09 +02:00
Teufelchen1
51537908d1 gnrc_lorawan: Ensure minimal packet length 2024-10-01 12:11:05 +02:00
Marian Buschsieweke
4f15523741
Merge pull request #20879 from benpicco/gnrc_sixlowpan_frag-gnrc_netif_pktq
gnrc_sixlowpan_frag: enable `gnrc_netif_pktq` if `netdev_new_api` is used
2024-09-30 14:00:33 +00:00