Skip to content

Commit

Permalink
nathelper: revert commit a45d4dc
Browse files Browse the repository at this point in the history
 - add comments to better explain logic behind code
  • Loading branch information
ovidiusas committed Feb 5, 2018
1 parent a45d4dc commit 1e36fa1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/nathelper/nathelper.c
Expand Up @@ -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)
Expand Down

0 comments on commit 1e36fa1

Please sign in to comment.