diff --git a/pkg/tinydtls/contrib/sock_dtls.c b/pkg/tinydtls/contrib/sock_dtls.c index 3692f36a13..315d80d076 100644 --- a/pkg/tinydtls/contrib/sock_dtls.c +++ b/pkg/tinydtls/contrib/sock_dtls.c @@ -515,7 +515,6 @@ ssize_t sock_dtls_recv_aux(sock_dtls_t *sock, sock_dtls_session_t *remote, void *data, size_t max_len, uint32_t timeout, sock_dtls_aux_rx_t *aux) { - (void)aux; assert(sock); assert(data); assert(remote); @@ -533,8 +532,13 @@ ssize_t sock_dtls_recv_aux(sock_dtls_t *sock, sock_dtls_session_t *remote, msg.type == DTLS_EVENT_CONNECTED) { return _complete_handshake(sock, remote, msg.content.ptr); } - res = sock_udp_recv(sock->udp_sock, data, max_len, timeout, - &remote->ep); + /* Crude way to somewhat test that `sock_dtls_aux_rx_t` and + * `sock_udp_aux_rx_t` remain compatible: */ + static_assert(sizeof(sock_dtls_aux_rx_t) == sizeof(sock_udp_aux_rx_t), + "sock_dtls_aux_rx_t became incompatible with " + "sock_udp_aux_rx_t"); + res = sock_udp_recv_aux(sock->udp_sock, data, max_len, timeout, + &remote->ep, (sock_udp_aux_rx_t *)aux); if (res <= 0) { DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res); return res;