Blob Blame Raw
From: Ovidiu Sas <osas@voipembedded.com>
Date: Mon, 5 Feb 2018 13:03:09 -0500
Subject: [PATCH] nathelper: manual backport for
 3c39167e333a8801772f49f8561a015bfa1836f1  - fix test condition for updateing
 IP for fix_nated_sdp()

(cherry picked from commit a45d4dcaf046bb273cfe5905ac035845a6867945)

diff --git a/modules/nathelper/nathelper.c b/modules/nathelper/nathelper.c
index df3e5740b..a919af12d 100644
--- a/modules/nathelper/nathelper.c
+++ b/modules/nathelper/nathelper.c
@@ -984,7 +984,7 @@ alter_mediaip(struct sip_msg *msg, str *body, str *oldip, int oldpf,
 	str omip, nip, oip;
 
 	/* check that updating mediaip is really necessary */
-	if (oldpf == newpf && isnulladdr(oldip, oldpf))
+	if (oldpf == newpf || isnulladdr(oldip, oldpf))
 		return 0;
 	if (newip->len == oldip->len &&
 	    memcmp(newip->s, oldip->s, newip->len) == 0)