From 4e35f473a4ecd5338bf05310926ef36ce0dbf7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1nos=20Brodbeck?= Date: Fri, 9 Oct 2020 22:56:45 +0200 Subject: [PATCH] sock/dtls: fix return value of sock_dtls_session_create() --- sys/include/net/sock/dtls.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/include/net/sock/dtls.h b/sys/include/net/sock/dtls.h index 1d64351443..abc5f3e728 100644 --- a/sys/include/net/sock/dtls.h +++ b/sys/include/net/sock/dtls.h @@ -794,7 +794,8 @@ static inline int sock_dtls_session_create(sock_dtls_t *sock, return res; } - return sock_dtls_recv(sock, remote, buf, sizeof(buf), timeout); + res = sock_dtls_recv(sock, remote, buf, sizeof(buf), timeout); + return res == -SOCK_DTLS_HANDSHAKE ? 0 : res; } #include "sock_dtls_types.h"