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

4965 Commits

Author SHA1 Message Date
Benjamin Valentin
2a6b8a3fed gnrc_netif: use different error messages for can't queue packet 2024-11-22 19:50:20 +01:00
benpicco
2bce94a7c7
Merge pull request #21012 from benpicco/netdev_new_api-relax
netdev_new_api: allow `.send()` to return > 0 to signal synchronos send
2024-11-20 22:28:26 +00:00
Benjamin Valentin
a86411b81e drivers/netdev: allow .send() to return > 0 to signal synchronos send 2024-11-20 16:40:36 +01:00
Benjamin Valentin
83f5b261a8 sys/net/gnrc_pktbuf: detect use after free if canary is in metadata 2024-11-19 15:23:03 +01:00
Benjamin Valentin
ea1670ab0f sys/net/gnrc_pktbuf: move CANARY to header file 2024-11-19 15:23:03 +01:00
Benjamin Valentin
278e8f53b7 sys/net/gnrc_pktbuf: fail assertion if illegal memory was freed 2024-11-19 15:23:03 +01:00
benpicco
aee4c1ef9c
Merge pull request #20984 from benpicco/gnrc_pktsnip_t-shrink
sys/net/gnrc/pkt: use `uint8_t` for user count
2024-11-17 17:29:16 +00:00
Marian Buschsieweke
51f969d655
Merge pull request #20993 from benpicco/netdev_new_api-enhance
gnrc_netif: netdev_new_api implies TX end irq, no need to check it
2024-11-17 08:45:19 +00:00
Marian Buschsieweke
2adb4042b3
Merge pull request #20974 from benpicco/gnrc_pktbuf_static-double-free
sys/net/gnrc_pktbuf_static: add double free detection
2024-11-16 09:03:42 +00:00
Marian Buschsieweke
fbf5c66f78
Merge pull request #20983 from benpicco/gnrc_netif_netdev_new_api-leak
gnrc_netif: fix packet leak with gnrc_netif_pktq & netdev_new_api
2024-11-15 22:46:54 +00:00
Benjamin Valentin
300a936e42 gnrc: add comment about gnrc_pktbuf_hold() use 2024-11-15 16:59:08 +01:00
Benjamin Valentin
e8b3b4d3e4 gnrc_pktbuf: assert that user count does not exceed 255 2024-11-15 16:41:42 +01:00
Benjamin Valentin
f82c41e96f gnrc_netif: netdev_new_api implies TX end irq, no need to check it 2024-11-14 17:11:58 +01:00
Benjamin Valentin
8eef1c1170 sys/net/gnrc/netif: don't release snip with netdev_new_api 2024-11-14 11:57:58 +01:00
Benjamin Valentin
b9b8c4a68f gnrc_netif: fix packet leak with gnrc_netif_pktq & netdev_new_api 2024-11-13 13:40:13 +01:00
Marian Buschsieweke
2623762c16
Merge pull request #20977 from maribu/net/grnc/tcp/select-netif
sys/net/gnrc/tcp: fix gnrc_tcp_open() netif handling
2024-11-13 05:31:00 +00:00
Marian Buschsieweke
e714707b14
sys/net/gnrc/tcp: fix gnrc_tcp_open() netif handling
gnrc_tcp_open() previously would eventually fail with a timeout without
sending any data when no netif was specified and a link-local target
address was used. This fixes the behavior:

- If there is only one netif, we just pick that
- If there are multiple netifs, fail directly with `-EINVAL` rather than
  sending out nothing and waiting for a timeout.

Co-authored-by: benpicco <benpicco@googlemail.com>
2024-11-12 15:44:41 +01:00
Benjamin Valentin
0bed0c6bfe gnrc_netif: fix double free with netdev_new_api & gnrc_netif_pktq 2024-11-11 20:30:30 +01:00
Benjamin Valentin
982af61c82 sys/net/gnrc_pktbuf_static: make hexdump optional 2024-11-11 15:17:40 +01:00
Benjamin Valentin
4bd273f009 sys/net/gnrc_pktbuf_static: add double free detection 2024-11-11 15:17:40 +01:00
Marian Buschsieweke
cec85cfc88
Merge pull request #20945 from maribu/sys/net/gcoap/replace-super-insane-hack-with-less-insane-hack
sys/net/gcoap: reduce insanity of hack
2024-11-08 20:03:37 +00: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
765dc3a299
sys/net/gcoap: reduce insanity of hack
gcoap contains a hack where a `coap_pkt_t` is pulled out of thin air,
parts of the members are left uninitialized and a function is called on
that mostly uninitialized data while crossing fingers hard that the
result will be correct. (With the current implementation of the used
function this hack does actually work.)

Estimated level of insanity: 😱😱😱😱😱

This adds to insane functions to get the length of a token and the
length of a header of a CoAP packet while crossing fingers hard that
the packet is valid and that the functions do not overread.

Estimated level of insanity: 😱😱😱

The newly introduced insane functions are used to replace the old
insane hack, resulting in an estimated reduction of insanity of 😱😱.

Side note: This actually does fix a bug, as the old code did not take
           into account the length of the extended TKL field in case of
           RFC 8974 being used. But that is a bug in the abused API,
           and not in the caller abusing the API.
2024-11-01 16:32:59 +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
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
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
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
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
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
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
Marian Buschsieweke
71b91a1d0e
sys/net/gcoap_forward_proxy: fix compilation issues 2024-10-14 14:30:20 +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
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
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