[Asterisk-code-review] res rtp asterisk: Revert DTLS negotiation changes. (asterisk[13.7])

Joshua Colp asteriskteam at digium.com
Sat Jan 9 18:43:29 CST 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/1977

Change subject: res_rtp_asterisk: Revert DTLS negotiation changes.
......................................................................

res_rtp_asterisk: Revert DTLS negotiation changes.

Due to locking issues within pjnath these changes are being
reverted until pjnath can be changed.

ASTERISK-25645

Revert "res_rtp_asterisk.c: Fix DTLS negotiation delays."

This reverts commit 24ae124e4f7310cfa64c187b944b2ffc060da28d.

Change-Id: I2986cfb2c43dc14455c1bcaf92c3804f9da49705

Revert "res_rtp_asterisk: Resolve further timing issues with DTLS negotiation"

This reverts commit 965a0eee46d24321f74c244e23c5a5f45e67e12b.

Change-Id: Ie68fafde27dad4b03cb7a1e27ce2a8502c3f7bbe
---
M res/res_rtp_asterisk.c
1 file changed, 0 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/77/1977/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 3dfaf87..f6bf342 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -2118,8 +2118,6 @@
 			SSL_set_accept_state(dtls->ssl);
 		}
 
-		ast_mutex_lock(&dtls->lock);
-
 		dtls_srtp_check_pending(instance, rtp, rtcp);
 
 		BIO_write(dtls->read_bio, buf, len);
@@ -2130,7 +2128,6 @@
 			unsigned long error = ERR_get_error();
 			ast_log(LOG_ERROR, "DTLS failure occurred on RTP instance '%p' due to reason '%s', terminating\n",
 				instance, ERR_reason_error_string(error));
-			ast_mutex_unlock(&dtls->lock);
 			return -1;
 		}
 
@@ -2147,8 +2144,6 @@
 			/* Since we've sent additional traffic start the timeout timer for retransmission */
 			dtls_srtp_start_timeout_timer(instance, rtp, rtcp);
 		}
-
-		ast_mutex_unlock(&dtls->lock);
 
 		return res;
 	}
@@ -4822,9 +4817,6 @@
 static void ast_rtp_remote_address_set(struct ast_rtp_instance *instance, struct ast_sockaddr *addr)
 {
 	struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
-#ifdef HAVE_OPENSSL_SRTP
-	struct dtls_details *dtls;
-#endif
 
 	if (rtp->rtcp) {
 		ast_debug(1, "Setting RTCP address on RTP instance '%p'\n", instance);
@@ -4841,28 +4833,6 @@
 		rtp->strict_rtp_state = STRICT_RTP_LEARN;
 		rtp_learning_seq_init(&rtp->rtp_source_learn, rtp->seqno);
 	}
-
-#ifdef HAVE_OPENSSL_SRTP
-	/* Trigger pending outbound DTLS packets received before the address was set.  Avoid unnecessary locking
-	 * by checking if we're passive. Without this, we only send the pending packets once a new SSL packet is
-	 * received in __rtp_recvfrom.
-	 */
-	dtls = &rtp->dtls;
-	if (dtls->dtls_setup == AST_RTP_DTLS_SETUP_PASSIVE) {
-		ast_mutex_lock(&dtls->lock);
-		dtls_srtp_check_pending(instance, rtp, 0);
-		ast_mutex_unlock(&dtls->lock);
-	}
-
-	if (rtp->rtcp) {
-		dtls = &rtp->rtcp->dtls;
-		if (dtls->dtls_setup == AST_RTP_DTLS_SETUP_PASSIVE) {
-			ast_mutex_lock(&dtls->lock);
-			dtls_srtp_check_pending(instance, rtp, 1);
-			ast_mutex_unlock(&dtls->lock);
-		}
-	}
-#endif
 
 	return;
 }

-- 
To view, visit https://gerrit.asterisk.org/1977
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie68fafde27dad4b03cb7a1e27ce2a8502c3f7bbe
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13.7
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list