Support Configurable MTU

- default to 1200
- minmimum value 576
pull/1262/head
Tinotenda Chingosho 5 years ago
parent d3390bae32
commit e4e106f423

@ -575,9 +575,9 @@ int dtls_connection_init(struct dtls_connection *d, struct packet_stream *ps, in
#if defined(SSL_OP_NO_QUERY_MTU)
SSL_CTX_set_options(d->ssl_ctx, SSL_OP_NO_QUERY_MTU);
SSL_set_mtu(d->ssl, 1500);
SSL_set_mtu(d->ssl, rtpe_config.dtls_mtu);
#if defined(DTLS_set_link_mtu) || defined(DTLS_CTRL_SET_LINK_MTU) || OPENSSL_VERSION_NUMBER >= 0x10100000L
DTLS_set_link_mtu(d->ssl, 1500);
DTLS_set_link_mtu(d->ssl, rtpe_config.dtls_mtu);
#endif
#endif

@ -79,6 +79,7 @@ struct rtpengine_config rtpe_config = {
.redis_connect_timeout = 1000,
.media_num_threads = -1,
.dtls_rsa_key_size = 2048,
.dtls_mtu = 1200, // chrome default mtu
.dtls_signature = 256,
.max_dtx = 30,
.dtx_shift = 5,
@ -477,6 +478,7 @@ static void options(int *argc, char ***argv) {
{ "jb-clock-drift",0,0, G_OPTION_ARG_NONE, &rtpe_config.jb_clock_drift,"Compensate for source clock drift",NULL },
{ "debug-srtp",0,0, G_OPTION_ARG_NONE, &debug_srtp, "Log raw encryption details for SRTP", NULL },
{ "dtls-rsa-key-size",0, 0, G_OPTION_ARG_INT,&rtpe_config.dtls_rsa_key_size,"Size of RSA key for DTLS", "INT" },
{ "dtls-mtu",0, 0, G_OPTION_ARG_INT,&rtpe_config.dtls_mtu,"DTLS MTU)", "INT" },
{ "dtls-ciphers",0, 0, G_OPTION_ARG_STRING, &rtpe_config.dtls_ciphers,"List of ciphers for DTLS", "STRING" },
{ "dtls-signature",0, 0,G_OPTION_ARG_STRING, &dtls_sig, "Signature algorithm for DTLS", "SHA-256|SHA-1" },
{ "listen-http", 0,0, G_OPTION_ARG_STRING_ARRAY,&rtpe_config.http_ifs,"Interface for HTTP and WS", "[IP46|HOSTNAME:]PORT"},
@ -722,6 +724,11 @@ static void options(int *argc, char ***argv) {
if (rtpe_config.dtls_rsa_key_size < 0)
die("Invalid --dtls-rsa-key-size (%i)", rtpe_config.dtls_rsa_key_size);
if (rtpe_config.dtls_mtu < 576)
/* The Internet Protocol requires that hosts must be able to process IP datagrams of at least 576 bytes (for IPv4) or 1280 bytes (for IPv6).
However, this does not preclude link layers with an MTU smaller than this minimum MTU from conveying IP data. Internet IPv4 path MTU is 68 bytes.*/
die("Invalid --dtls-mtu (%i)", rtpe_config.dtls_mtu);
if (rtpe_config.jb_length < 0)
die("Invalid negative jitter buffer size");

@ -103,6 +103,7 @@ struct rtpengine_config {
int jb_length;
int jb_clock_drift;
int dtls_rsa_key_size;
int dtls_mtu;
char *dtls_ciphers;
int dtls_signature;
char **http_ifs;

Loading…
Cancel
Save