Blob Blame Raw
From: Ovidiu Sas <osas@voipembedded.com>
Date: Mon, 5 Feb 2018 15:58:20 -0500
Subject: [PATCH] rtpproxy: revert commit
 ee2731212303eb7055b3bd165464fe44fae05e7b  - add comments to better explain
 logic behind code

(cherry picked from commit ebbe49c50ce045a41b390198e3ee731450aaf600)

diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c
index c68ba7251..945a89111 100644
--- a/modules/rtpproxy/rtpproxy.c
+++ b/modules/rtpproxy/rtpproxy.c
@@ -1898,7 +1898,11 @@ alter_mediaip(struct sip_msg *msg, str *body, str *oldip, int oldpf,
 	str omip, nip, oip;
 
 	/* check that updating media-ip is really necessary */
-	if (oldpf == newpf || isnulladdr(oldip, oldpf))
+	/* Conditions:
+	- same IP protocol format for received IP and new IP
+	- null IP received
+	*/
+	if (oldpf == newpf && isnulladdr(oldip, oldpf))
 		return 0;
 	if (newip->len == oldip->len &&
 	    memcmp(newip->s, oldip->s, newip->len) == 0)