1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avformat/tls_openssl: set default MTU if none is set

This commit is contained in:
Timo Rothenpieler
2025-07-12 22:11:17 +02:00
parent b6e808d28b
commit 576f44016a

View File

@ -839,13 +839,17 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
/* Setup the callback for logging. */ /* Setup the callback for logging. */
SSL_set_ex_data(p->ssl, 0, p); SSL_set_ex_data(p->ssl, 0, p);
SSL_set_info_callback(p->ssl, openssl_info_callback); SSL_set_info_callback(p->ssl, openssl_info_callback);
/** /**
* We have set the MTU to fragment the DTLS packet. It is important to note that the * We have set the MTU to fragment the DTLS packet. It is important to note that the
* packet is split to ensure that each handshake packet is smaller than the MTU. * packet is split to ensure that each handshake packet is smaller than the MTU.
*/ */
if (c->mtu <= 0)
c->mtu = 1096;
SSL_set_options(p->ssl, SSL_OP_NO_QUERY_MTU); SSL_set_options(p->ssl, SSL_OP_NO_QUERY_MTU);
SSL_set_mtu(p->ssl, p->tls_shared.mtu); SSL_set_mtu(p->ssl, c->mtu);
DTLS_set_link_mtu(p->ssl, p->tls_shared.mtu); DTLS_set_link_mtu(p->ssl, c->mtu);
ret = init_bio_method(h); ret = init_bio_method(h);
if (ret < 0) if (ret < 0)
goto fail; goto fail;