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

pkg/tinydtls: Set buffer size as required for gcoap

This commit is contained in:
chrysn 2023-03-02 09:15:51 +01:00
parent e9333feac2
commit 5d741b9d41

View File

@ -18,3 +18,18 @@ all:
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