From 2c1e356c9434b4419274496907413ad5186abebd Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 4 Sep 2004 00:30:53 +0000 Subject: Fix FreeBSD transparent proxy code --- common/smtppass.c | 4 +++- src/clamsmtpd.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/smtppass.c b/common/smtppass.c index 14744f9..31b67ce 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -662,7 +662,7 @@ static int connect_out(clamsmtp_context_t* ctx) #ifdef LINUX_TRANSPARENT_PROXY if(getsockopt(ctx->client.fd, SOL_IP, SO_ORIGINAL_DST, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1) #else - if(getsockname(ctx->client.fd, &SANY_ADDR(addr1), &SANY_LEN(addr1)) == -1) + if(getsockname(ctx->client.fd, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1) #endif { message(ctx, LOG_ERR, "couldn't get source address for transparent proxying"); @@ -706,6 +706,8 @@ static int connect_out(clamsmtp_context_t* ctx) if(outaddr != &(g_state->outaddr)) { if(sock_any_ntop(outaddr, buf, MAXPATHLEN, 0) != -1) + outname = buf; + else outname = "unknown"; } diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c index 14744f9..31b67ce 100644 --- a/src/clamsmtpd.c +++ b/src/clamsmtpd.c @@ -662,7 +662,7 @@ static int connect_out(clamsmtp_context_t* ctx) #ifdef LINUX_TRANSPARENT_PROXY if(getsockopt(ctx->client.fd, SOL_IP, SO_ORIGINAL_DST, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1) #else - if(getsockname(ctx->client.fd, &SANY_ADDR(addr1), &SANY_LEN(addr1)) == -1) + if(getsockname(ctx->client.fd, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1) #endif { message(ctx, LOG_ERR, "couldn't get source address for transparent proxying"); @@ -706,6 +706,8 @@ static int connect_out(clamsmtp_context_t* ctx) if(outaddr != &(g_state->outaddr)) { if(sock_any_ntop(outaddr, buf, MAXPATHLEN, 0) != -1) + outname = buf; + else outname = "unknown"; } -- cgit v1.2.3