From c2377fd2669caea8b71e94fc7acb584b2e05c7c4 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Thu, 6 Nov 2025 17:11:38 +0100 Subject: [PATCH] DTLS: Clear userSet when peer is set in EmbedReceiveFrom This allows us to differentiate between the user explicitly setting a peer and wolfio setting it. When wolfio sets the peer, we want to be able to update the peer address while in stateless parsing (governed by the `newPeer` variable). --- src/wolfio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wolfio.c b/src/wolfio.c index 53a5ad0c6..599978e71 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -872,6 +872,7 @@ int EmbedReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *ctx) /* Store size of saved address. Locking handled internally. */ if (wolfSSL_dtls_set_peer(ssl, peer, peerSz) != WOLFSSL_SUCCESS) return WOLFSSL_CBIO_ERR_GENERAL; + dtlsCtx->userSet = 0; } #ifndef WOLFSSL_PEER_ADDRESS_CHANGES else {