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

pkg/tinydtls: Implement sock_aux_local

This commit is contained in:
Marian Buschsieweke 2020-07-28 14:39:30 +02:00
parent 599c2a145e
commit f222a3f2e9
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -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;