[Asterisk-code-review] res rtp asterisk.c: Check RTP packet version earlier. (asterisk[14])

Jenkins2 asteriskteam at digium.com
Wed Sep 6 09:41:29 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6411 )

Change subject: res_rtp_asterisk.c: Check RTP packet version earlier.
......................................................................

res_rtp_asterisk.c: Check RTP packet version earlier.

Change-Id: Ic6493a7d79683f3e5845dff1cee49445fd5a0adf
---
M res/res_rtp_asterisk.c
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index fa0baf2..acc61c7 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -5069,6 +5069,11 @@
 		return &ast_null_frame;
 	}
 
+	/* If the version is not what we expected by this point then just drop the packet */
+	if (version != 2) {
+		return &ast_null_frame;
+	}
+
 	/* If strict RTP protection is enabled see if we need to learn the remote address or if we need to drop the packet */
 	if (rtp->strict_rtp_state == STRICT_RTP_LEARN) {
 		if (!ast_sockaddr_cmp(&rtp->strict_rtp_address, &addr)) {
@@ -5113,11 +5118,6 @@
 				ast_debug(0, "RTP NAT: Got audio from other end. Now sending to address %s\n",
 					  ast_sockaddr_stringify(&remote_address));
 		}
-	}
-
-	/* If the version is not what we expected by this point then just drop the packet */
-	if (version != 2) {
-		return &ast_null_frame;
 	}
 
 	/* Pull out the various other fields we will need */

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

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6493a7d79683f3e5845dff1cee49445fd5a0adf
Gerrit-Change-Number: 6411
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170906/b9849d4b/attachment.html>


More information about the asterisk-code-review mailing list