From 9c8bdabc2095d1a0dc596319d3495f9fb2118d1a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 3 Jun 2013 16:52:47 +0100 Subject: [PATCH] Fix wildcard addresses in config. --- src/cfg_utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cfg_utils.c b/src/cfg_utils.c index 78530218d..bb673c7d9 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -71,8 +71,12 @@ parse_host_port_priority (memory_pool_t *pool, const gchar *str, gchar **addr, g hints.ai_next = NULL; if (strcmp (tokens[0], "*") == 0) { - cur_tok = NULL; - hints.ai_flags |= AI_PASSIVE; + /* XXX: actually we still cannot listen on multiply protocols */ + if (pool != NULL) { + *addr = memory_pool_alloc (pool, INET_ADDRSTRLEN + 1); + } + rspamd_strlcpy (*addr, "0.0.0.0", INET_ADDRSTRLEN + 1); + goto port_parse; } else { cur_tok = tokens[0]; @@ -99,6 +103,8 @@ parse_host_port_priority (memory_pool_t *pool, const gchar *str, gchar **addr, g msg_err ("address resolution for %s failed: %s", tokens[0], gai_strerror (r)); goto err; } + +port_parse: if (tokens[1] != NULL) { /* Port part */ if (port != NULL) { -- 2.39.5