From 1e36fa1afafb90fcffcd88fdecc5c74e24ceb990 Mon Sep 17 00:00:00 2001 From: Ovidiu Sas Date: Mon, 5 Feb 2018 15:32:03 -0500 Subject: [PATCH] nathelper: revert commit a45d4dcaf046bb273cfe5905ac035845a6867945 - add comments to better explain logic behind code --- modules/nathelper/nathelper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/nathelper/nathelper.c b/modules/nathelper/nathelper.c index bf76ea4fd41..7abc51d9a3c 100644 --- a/modules/nathelper/nathelper.c +++ b/modules/nathelper/nathelper.c @@ -978,7 +978,11 @@ 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)) + /* 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)