pkg/tinydtls: Implement sock_aux_local
This commit is contained in:
parent
599c2a145e
commit
f222a3f2e9
@ -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,
|
void *data, size_t max_len, uint32_t timeout,
|
||||||
sock_dtls_aux_rx_t *aux)
|
sock_dtls_aux_rx_t *aux)
|
||||||
{
|
{
|
||||||
(void)aux;
|
|
||||||
assert(sock);
|
assert(sock);
|
||||||
assert(data);
|
assert(data);
|
||||||
assert(remote);
|
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) {
|
msg.type == DTLS_EVENT_CONNECTED) {
|
||||||
return _complete_handshake(sock, remote, msg.content.ptr);
|
return _complete_handshake(sock, remote, msg.content.ptr);
|
||||||
}
|
}
|
||||||
res = sock_udp_recv(sock->udp_sock, data, max_len, timeout,
|
/* Crude way to somewhat test that `sock_dtls_aux_rx_t` and
|
||||||
&remote->ep);
|
* `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) {
|
if (res <= 0) {
|
||||||
DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res);
|
DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user