mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #14706 from maribu/sock-aux-dtls
pkg/tinydtls: Implement sock_aux_local
This commit is contained in:
commit
5673adaf48
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user