Skip to content

Commit 7f7e02e

Browse files
committed
pkg/tinydtls: Implement sock_aux_local
1 parent e111c4b commit 7f7e02e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/tinydtls/contrib/sock_dtls.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ ssize_t sock_dtls_recv_aux(sock_dtls_t *sock, sock_dtls_session_t *remote,
515515
void *data, size_t max_len, uint32_t timeout,
516516
sock_dtls_aux_rx_t *aux)
517517
{
518-
(void)aux;
519518
assert(sock);
520519
assert(data);
521520
assert(remote);
@@ -533,8 +532,13 @@ ssize_t sock_dtls_recv_aux(sock_dtls_t *sock, sock_dtls_session_t *remote,
533532
msg.type == DTLS_EVENT_CONNECTED) {
534533
return _complete_handshake(sock, remote, msg.content.ptr);
535534
}
536-
res = sock_udp_recv(sock->udp_sock, data, max_len, timeout,
537-
&remote->ep);
535+
/* Crude way to somewhat test that `sock_dtls_aux_rx_t` and
536+
* `sock_udp_aux_rx_t` remain compatible: */
537+
static_assert(sizeof(sock_dtls_aux_rx_t) == sizeof(sock_udp_aux_rx_t),
538+
"sock_dtls_aux_rx_t became incompatible with "
539+
"sock_udp_aux_rx_t");
540+
res = sock_udp_recv_aux(sock->udp_sock, data, max_len, timeout,
541+
&remote->ep, (sock_udp_aux_rx_t *)aux);
538542
if (res <= 0) {
539543
DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res);
540544
return res;

0 commit comments

Comments
 (0)