[riot-notifications] [RIOT-OS/RIOT] sock/dtls: add function to retrieve epoch of session (#15881)

János Brodbeck notifications at github.com
Fri Jan 29 22:47:09 CET 2021

@janosbrodbeck commented on this pull request.

> @@ -296,6 +296,19 @@ int sock_dtls_create(sock_dtls_t *sock, sock_udp_t *udp_sock,
     return 0;
+int16_t sock_dtls_session_get_epoch(sock_dtls_t *sock, sock_dtls_session_t *session)
+    assert(sock);
+    assert(session);
+    dtls_peer_t *peer = dtls_get_peer(sock->dtls_ctx, &session->dtls_session);
+    if (!peer) {
+        return -ENOTCONN;
+    }
+    dtls_security_parameters_t *security = dtls_security_params(peer);

No, `dtls_security_params()` always returns the first security parameter in the array (there are always two security_param objects per peer). And only the second one gets freed (except in `free_peer()`, but then the peer is not found anymore).

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210129/71f1a39f/attachment.htm>

More information about the notifications mailing list