From 8d9516871b70786a63f80601dbe7336cf7e3a138 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 13 Mar 2015 10:21:19 +0000 Subject: [PATCH] Fix sockets initialization. --- src/libserver/cfg_utils.c | 1 + src/libutil/addr.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 19fac3488..983a73f3f 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -130,6 +130,7 @@ rspamd_parse_bind_line (struct rspamd_config *cfg, ret = FALSE; } else { + cnf->cnt = cnf->addrs->len; LL_PREPEND (cf->bind_conf, cnf); } } diff --git a/src/libutil/addr.c b/src/libutil/addr.c index c2bb3db9c..1cfe2992b 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -77,6 +77,9 @@ rspamd_ip_validate_af (rspamd_inet_addr_t *addr) addr->u.in.addr.sa.sa_family = addr->af; } } + else { + addr->u.un->addr.sun_family = AF_UNIX; + } if (addr->af == AF_INET) { addr->slen = sizeof (struct sockaddr_in); @@ -320,6 +323,7 @@ rspamd_parse_unix_path (rspamd_inet_addr_t **target, const char *src) } if (target) { + rspamd_ip_validate_af (addr); *target = addr; } else { -- 2.39.5