Skip to content

Commit abfd948

Browse files
committed
[nrf fromtree] net: lwm2m: Use CID_SUPPORTED instead of CID_ENABLED
When ENABLED flag is used, we generate 32 byte DTLS Connection Identifier and include that in our DTLS Client HELO. This has no benefit as client only has one connection toward the server, it does not need any identification. When SUPPORTED flag is used, we just include zero length Connection Identifier in the handshake, which tell server that we support Connection Identifier and server can generate one for it. We then use the CID in the packets that we send towards server, but response packets don't contain any CID. This gives all the benefit of CID as server is able to identify us even when NAT mapping have changed. Signed-off-by: Seppo Takalo <[email protected]> (cherry picked from commit 9929363)
1 parent ed40749 commit abfd948

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/lwm2m/lwm2m_engine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ int lwm2m_set_default_sockopt(struct lwm2m_ctx *ctx)
10601060
}
10611061
if (IS_ENABLED(CONFIG_LWM2M_DTLS_CID)) {
10621062
/* Enable CID */
1063-
int cid = TLS_DTLS_CID_ENABLED;
1063+
int cid = TLS_DTLS_CID_SUPPORTED;
10641064

10651065
ret = zsock_setsockopt(ctx->sock_fd, SOL_TLS, TLS_DTLS_CID, &cid,
10661066
sizeof(cid));

0 commit comments

Comments
 (0)