[Asterisk-code-review] res_rtp_asterisk: Always return provided DTLS packet length. (asterisk[master])

George Joseph asteriskteam at digium.com
Mon Nov 18 13:04:09 CST 2019


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13207 )

Change subject: res_rtp_asterisk: Always return provided DTLS packet length.
......................................................................

res_rtp_asterisk: Always return provided DTLS packet length.

OpenSSL can not tolerate if the packet sent out does not
match the length that it provided to the sender. This change
lies and says that each time the full packet was sent. If
a problem does occur then a retransmission will occur as
appropriate.

ASTERISK-28576

Change-Id: Id42455b15c9dc4eb987c8c023ece6fbf3c22a449
---
M res/res_rtp_asterisk.c
1 file changed, 8 insertions(+), 2 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 19c7338..bac5734 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -660,6 +660,10 @@
 	struct ast_sockaddr remote_address = { {0, } };
 	int ice;
 
+	/* OpenSSL can't tolerate a packet not being sent, so we always state that
+	 * we sent the packet. If it isn't then retransmission will occur.
+	 */
+
 	if (rtp->rtcp && rtp->rtcp->dtls.write_bio == bio) {
 		rtcp = 1;
 		ast_sockaddr_copy(&remote_address, &rtp->rtcp->them);
@@ -668,10 +672,12 @@
 	}
 
 	if (ast_sockaddr_isnull(&remote_address)) {
-		return 0;
+		return len;
 	}
 
-	return __rtp_sendto(instance, (char *)buf, len, 0, &remote_address, rtcp, &ice, 0);
+	__rtp_sendto(instance, (char *)buf, len, 0, &remote_address, rtcp, &ice, 0);
+
+	return len;
 }
 
 static long dtls_bio_ctrl(BIO *bio, int cmd, long arg1, void *arg2)

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13207
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Id42455b15c9dc4eb987c8c023ece6fbf3c22a449
Gerrit-Change-Number: 13207
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191118/f848ea3d/attachment.html>


More information about the asterisk-code-review mailing list