From 39ba95a3ed234e25f311668a2e171bf667544a2c Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 26 Feb 2024 20:14:47 +0100 Subject: [PATCH] sys/net/nanocoap: ensure DTLS buffer is at least 200 bytes --- sys/net/application_layer/nanocoap/Makefile.include | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/net/application_layer/nanocoap/Makefile.include b/sys/net/application_layer/nanocoap/Makefile.include index c8b8b33d8a..1ce0a348c9 100644 --- a/sys/net/application_layer/nanocoap/Makefile.include +++ b/sys/net/application_layer/nanocoap/Makefile.include @@ -1,4 +1,7 @@ ifneq (,$(filter nanocoap_dtls,$(USEMODULE))) CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT := $(or $(CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT),2) - DTLS_MAX_BUF ?= ((1 << ($(CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT) + 3)) + 36) + NANOCOAP_BLOCK_FRAME := (1 << ($(CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT) + 4)) + 36 + NANOCOAP_BLOCK_FRAME := $(shell echo $$((${NANOCOAP_BLOCK_FRAME}))) + # the initial DTLS handshake may exceed the block size + DTLS_MAX_BUF ?= $(shell echo $$((${NANOCOAP_BLOCK_FRAME} > 200 ? ${NANOCOAP_BLOCK_FRAME} : 200 ))) endif