aboutsummaryrefslogtreecommitdiffstats
path: root/src/smtp_proxy.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-01 15:52:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-01 15:52:11 +0100
commit37845898cbf779c7d3b5664997d0db48968c929c (patch)
treea190b5ee9d152ba60135136bbe8108d7da81166c /src/smtp_proxy.c
parent8cc2aee8859731ee2fe280070423f79e7d009ca3 (diff)
downloadrspamd-37845898cbf779c7d3b5664997d0db48968c929c.tar.gz
rspamd-37845898cbf779c7d3b5664997d0db48968c929c.zip
Rework socket creation logic to support both ipv4 and ipv6 sockets.
Diffstat (limited to 'src/smtp_proxy.c')
-rw-r--r--src/smtp_proxy.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/smtp_proxy.c b/src/smtp_proxy.c
index 4cf7fae9f..e7856898d 100644
--- a/src/smtp_proxy.c
+++ b/src/smtp_proxy.c
@@ -439,7 +439,6 @@ static gboolean
create_smtp_proxy_upstream_connection (struct smtp_proxy_session *session)
{
struct smtp_upstream *selected;
- struct sockaddr_un *un;
/* Try to select upstream */
selected = (struct smtp_upstream *)get_upstream_round_robin (session->ctx->upstreams,
@@ -453,13 +452,7 @@ create_smtp_proxy_upstream_connection (struct smtp_proxy_session *session)
session->upstream = selected;
/* Now try to create socket */
- if (selected->is_unix) {
- un = alloca (sizeof (struct sockaddr_un));
- session->upstream_sock = make_unix_socket (selected->name, un, FALSE, TRUE);
- }
- else {
- session->upstream_sock = make_tcp_socket (&selected->addr, selected->port, FALSE, TRUE);
- }
+ session->upstream_sock = make_universal_socket (selected->name, selected->port, SOCK_STREAM, TRUE, FALSE, FALSE);
if (session->upstream_sock == -1) {
msg_err ("cannot make a connection to %s", selected->name);
upstream_fail (&selected->up, time (NULL));