[riot-notifications] [RIOT-OS/RIOT] sock_dtls: add timeout to sock_dtls_send and sock_dtls_session_create (#14043)

Martine Lenders notifications at github.com
Thu May 14 17:56:40 CEST 2020


@miri64 commented on this pull request.



>  {
-    uint8_t rcv_buffer[DTLS_HANDSHAKE_BUFSIZE];
-    msg_t msg;
-    ssize_t res;
-
     assert(sock);
     assert(ep);
     assert(remote);

This way, your code is up to the spec:

```suggestion
    assert(remote);
    sock_udp_ep_t local;
    
    if (sock_udp_get_local(sock->udp_sock, &local) < 0) {
        return -EADDRUNAVAIL;
    }
    if (ep->port == 0) {
        return -EINVAL;
    }
    switch (ep->family) {
        case AF_INET:
 #if IS_ACTIVE(SOCK_HAS_IPV6)
        case AF_INET6:
 #endif
            break;
        default:
            return -EINVAL;
    }
```

(did not compile test this one... hope you know what I mean)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14043#pullrequestreview-411946688
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200514/1f6ca66a/attachment.htm>


More information about the notifications mailing list