1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/net/application_layer/gcoap
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
..
include gcoap/forward_proxy: reply from request destination address 2024-05-31 12:04:48 +02:00
dns.c treewide: adapt to gcoap_req_send aux local API change 2024-05-31 12:04:48 +02:00
forward_proxy_thread.c treewide: clean up remnants of THREAD_CREATE_STACKTEST 2024-10-07 17:31:31 +02:00
forward_proxy.c Merge pull request #20915 from fabian18/pr/gcoap_forward_proxy_timeout 2024-10-23 21:58:57 +00:00
gcoap.c sys/net/gcoap: reduce insanity of hack 2024-11-01 16:32:59 +01:00
Kconfig *Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Makefile nanocoap: make coap_request_ctx_t members internal 2022-07-17 14:32:16 +02:00
Makefile.include sys/net/application_layer/gcoap: include header in path 2024-04-25 13:30:16 +02:00