From 3cba2974eebe27c6fb0b9a4e15786b4ae436f877 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Thu, 26 Sep 2024 11:09:46 +0100 Subject: [PATCH] coap_tinydtls.c: Fix server only build for CID --- src/coap_tinydtls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coap_tinydtls.c b/src/coap_tinydtls.c index 27c0200d8c..d3ec68176c 100644 --- a/src/coap_tinydtls.c +++ b/src/coap_tinydtls.c @@ -882,7 +882,7 @@ coap_dtls_send(coap_session_t *session, if (coap_event_dtls != COAP_EVENT_DTLS_CLOSED) coap_handle_event_lkd(session->context, coap_event_dtls, session); if (coap_event_dtls == COAP_EVENT_DTLS_CONNECTED) { -#if (DTLS_MAX_CID_LENGTH > 0) +#if (DTLS_MAX_CID_LENGTH > 0) && COAP_CLIENT_SUPPORT if (session->type == COAP_SESSION_TYPE_CLIENT) { dtls_peer_t *peer = dtls_get_peer(dtls_context, (session_t *)session->tls); dtls_security_parameters_t *security = dtls_security_params(peer); @@ -894,7 +894,7 @@ coap_dtls_send(coap_session_t *session, session->negotiated_cid = 0; } } -#endif /* DTLS_MAX_CID_LENGTH > 0 */ +#endif /* DTLS_MAX_CID_LENGTH > 0 && COAP_CLIENT_SUPPORT */ coap_session_connected(session); } else if (coap_event_dtls == COAP_EVENT_DTLS_CLOSED || coap_event_dtls == COAP_EVENT_DTLS_ERROR) { coap_session_disconnected_lkd(session, COAP_NACK_TLS_FAILED); @@ -966,7 +966,7 @@ coap_dtls_receive(coap_session_t *session, coap_handle_event_lkd(session->context, coap_event_dtls, session); if (coap_event_dtls == COAP_EVENT_DTLS_CONNECTED) { coap_session_connected(session); -#if (DTLS_MAX_CID_LENGTH > 0) +#if (DTLS_MAX_CID_LENGTH > 0) && COAP_CLIENT_SUPPORT if (session->type == COAP_SESSION_TYPE_CLIENT) { dtls_peer_t *peer = dtls_get_peer(dtls_context, (session_t *)session->tls); dtls_security_parameters_t *security = dtls_security_params(peer); @@ -977,7 +977,7 @@ coap_dtls_receive(coap_session_t *session, session->negotiated_cid = 0; } } -#endif /* DTLS_MAX_CID_LENGTH > 0 */ +#endif /* DTLS_MAX_CID_LENGTH > 0 && COAP_CLIENT_SUPPORT */ } else if (coap_event_dtls == COAP_EVENT_DTLS_CLOSED || coap_event_dtls == COAP_EVENT_DTLS_ERROR) { coap_session_disconnected_lkd(session, COAP_NACK_TLS_FAILED); err = -1;