Ensure we use a dgram mem BIO for the DTLS record layer
@@ -1893,6 +1893,9 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
&& level != OSSL_RECORD_PROTECTION_LEVEL_NONE)
epoch = DTLS_RECORD_LAYER_get_r_epoch(&s->rlayer) + 1; /* new epoch */
+ if (SSL_CONNECTION_IS_DTLS(s))
+ s->rrlnext = BIO_new(BIO_s_dgram_mem());
+ else
s->rrlnext = BIO_new(BIO_s_mem());
if (s->rrlnext == NULL) {
