From 252ec917824aaeefd76f82c4e45364b5e8d01dfa Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Mon, 21 Aug 2023 09:33:52 +0200 Subject: [PATCH] pkg/tinydtls: allow to set buffer size from application again --- pkg/tinydtls/Makefile | 15 --------------- pkg/tinydtls/Makefile.include | 3 +++ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/pkg/tinydtls/Makefile b/pkg/tinydtls/Makefile index 093ed79ab8..8f314cb772 100644 --- a/pkg/tinydtls/Makefile +++ b/pkg/tinydtls/Makefile @@ -19,21 +19,6 @@ ifeq (llvm,$(TOOLCHAIN)) CFLAGS += -Wno-format-nonliteral endif -ifneq (,$(filter gcoap,$(USEMODULE))) - # Configuring the buffer large enough that a full Gcoap packet can be - # encrypted or decrypted. - - # This is the default in gcoap.h, which we don't have access to, so it is copied over. - CONFIG_GCOAP_PDU_BUF_SIZE := $(or $(CONFIG_GCOAP_PDU_BUF_SIZE),128) - - # If there were another way to set up DTLS_MAX_BUF, we'd need to set the - # maximum of these here. - # - # 29 bytes are the overhead measured with Wireshark on packets exchanged in - # default configuration; adding some to be safe against variable size fields. - CFLAGS += "-DDTLS_MAX_BUF=($(CONFIG_GCOAP_PDU_BUF_SIZE) + 36)" -endif - # TinyDTLS emits several messages during connection establishment at the info # level; this is way more verbose than common in RIOT. TINYDTLS_LOG_LEVEL ?= LOG_WARNING diff --git a/pkg/tinydtls/Makefile.include b/pkg/tinydtls/Makefile.include index 79245a2b98..9d4add6ccf 100644 --- a/pkg/tinydtls/Makefile.include +++ b/pkg/tinydtls/Makefile.include @@ -75,3 +75,6 @@ HANDSHAKE_MAX := $(or $(CONFIG_DTLS_HANDSHAKE_MAX),$(patsubst -DCONFIG_DTLS_HAND ifneq (,$(HANDSHAKE_MAX)) CFLAGS += -DDTLS_HANDSHAKE_MAX=$(HANDSHAKE_MAX) endif + +DTLS_MAX_BUF ?= 200 +CFLAGS += "-DDTLS_MAX_BUF=$(DTLS_MAX_BUF)"