Skip to content

Commit

Permalink
Merge pull request #77 from jcbf/bugfix/#76_clientipnat
Browse files Browse the repository at this point in the history
Fix #76
  • Loading branch information
jcbf authored Aug 7, 2020
2 parents 3c54545 + f450f11 commit 7003197
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions smf-spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,10 +848,9 @@ static sfsistat smf_connect(SMFICTX *ctx, char *name, _SOCK_ADDR *sa) {
smfi_setpriv(ctx, context);
if (conf.ipnats && (d_ip = natip_check(inet_addr(host)))) {
snprintf(context->addr, sizeof(context->addr), "%li.%li.%li.%li",
d_ip >> 24 & 0xff, d_ip >> 16 & 0xff, d_ip >> 8 & 0xff, d_ip & 0xff);
d_ip & 0xff, d_ip >> 8 & 0xff, d_ip >> 16 & 0xff, d_ip >> 24 & 0xff);
log_message(LOG_INFO, "Found NAT IP address. Original: %s . Final %li (%s)", host, d_ip,context->addr);
}
if (conf.fixed_ip)
} else if (conf.fixed_ip)
strscpy(context->addr, conf.fixed_ip, sizeof(context->addr) - 1);
else
strscpy(context->addr, host, sizeof(context->addr) - 1);
Expand Down

0 comments on commit 7003197

Please sign in to comment.