aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 12:46:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 12:46:12 +0100
commitc9a308dad408f6bc60ac522ccd0d1ec1479aa216 (patch)
treed732392d37dc948a7ac2df36bf29161f83163d84 /src
parentde4532aba29f10943776f85ae625633eb8c8406f (diff)
downloadrspamd-c9a308dad408f6bc60ac522ccd0d1ec1479aa216.tar.gz
rspamd-c9a308dad408f6bc60ac522ccd0d1ec1479aa216.zip
Fix issues with resolving v4/v6 addresses for bind.
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_utils.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index f2b56b364..d041faa50 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -215,7 +215,6 @@ rspamd_parse_bind_line (struct rspamd_config *cfg, struct rspamd_worker_conf *cf
if (*tokens[0] == '/' || *tokens[0] == '.') {
cnf->ai = AF_UNIX;
LL_PREPEND (cf->bind_conf, cnf);
- return TRUE;
}
else if (strcmp (tokens[0], "*") == 0) {
/* We need to add two listen entries: one for ipv4 and one for ipv6 */
@@ -245,12 +244,24 @@ rspamd_parse_bind_line (struct rspamd_config *cfg, struct rspamd_worker_conf *cf
if (err == NULL || *err == '\0') {
LL_PREPEND (cf->bind_conf, cnf);
}
+ else {
+ ret = FALSE;
+ }
}
else {
- if ((ret = parse_host_port_priority_strv (cfg->cfg_pool, tokens,
- &cnf->bind_host, &cnf->bind_port, NULL, DEFAULT_BIND_PORT))) {
+ cnf->bind_host = rspamd_mempool_strdup (cfg->cfg_pool, tokens[0]);
+ if (tokens[1] == NULL) {
+ cnf->bind_port = DEFAULT_BIND_PORT;
+ }
+ else {
+ cnf->bind_port = strtoul (tokens[1], &err, 10);
+ }
+ if (err == NULL || *err == '\0') {
LL_PREPEND (cf->bind_conf, cnf);
}
+ else {
+ ret = FALSE;
+ }
}
g_strfreev (tokens);