Skip to content

Commit c2377fd

Browse files
committed
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).
1 parent 975033c commit c2377fd

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/wolfio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@ int EmbedReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *ctx)
872872
/* Store size of saved address. Locking handled internally. */
873873
if (wolfSSL_dtls_set_peer(ssl, peer, peerSz) != WOLFSSL_SUCCESS)
874874
return WOLFSSL_CBIO_ERR_GENERAL;
875+
dtlsCtx->userSet = 0;
875876
}
876877
#ifndef WOLFSSL_PEER_ADDRESS_CHANGES
877878
else {

0 commit comments

Comments
 (0)