diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-16 17:22:07 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-16 17:22:07 +0400 |
commit | aa1438ae5a373d9775c228443e30da6e41df8ae9 (patch) | |
tree | 7c560236210c8d058b3b1d4cb55fe8414673f740 /src/dns.c | |
parent | 0ca0676e9716808a09be85944165cd49607afc3c (diff) | |
download | rspamd-aa1438ae5a373d9775c228443e30da6e41df8ae9.tar.gz rspamd-aa1438ae5a373d9775c228443e30da6e41df8ae9.zip |
Do not break lua plugins if there is no DNS.
Diffstat (limited to 'src/dns.c')
-rw-r--r-- | src/dns.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1435,6 +1435,10 @@ make_dns_request (struct rspamd_dns_resolver *resolver, gint r; struct dns_header *header; + /* If no DNS servers defined silently return FALSE */ + if (resolver->servers_num == 0) { + return FALSE; + } /* Check throttling */ if (resolver->throttling) { return FALSE; @@ -1629,7 +1633,7 @@ dns_resolver_init (struct event_base *ev_base, struct config_file *cfg) /* Parse resolv.conf */ if (! parse_resolv_conf (new) || new->servers_num == 0) { msg_err ("cannot parse resolv.conf and no nameservers defined, so no ways to resolve addresses"); - return NULL; + return new; } } else { @@ -1684,7 +1688,7 @@ dns_resolver_init (struct event_base *ev_base, struct config_file *cfg) msg_err ("no valid nameservers defined, try to parse resolv.conf"); if (! parse_resolv_conf (new) || new->servers_num == 0) { msg_err ("cannot parse resolv.conf and no nameservers defined, so no ways to resolve addresses"); - return NULL; + return new; } } |