mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MINOR: config: Warn if resolvers has no nameservers
Today, a `resolvers` section may be configured without any `nameserver` directives, which is useless. This implements a warning when such sections are detected. [List thread][1]. [1]: https://www.mail-archive.com/haproxy@formilux.org/msg29600.html
This commit is contained in:
parent
9a66dfbd6c
commit
054fbee67a
@ -7336,6 +7336,7 @@ int check_config_validity()
|
|||||||
struct bind_conf *bind_conf;
|
struct bind_conf *bind_conf;
|
||||||
char *err;
|
char *err;
|
||||||
struct cfg_postparser *postparser;
|
struct cfg_postparser *postparser;
|
||||||
|
struct dns_resolvers *curr_resolvers = NULL;
|
||||||
|
|
||||||
bind_conf = NULL;
|
bind_conf = NULL;
|
||||||
/*
|
/*
|
||||||
@ -8976,6 +8977,15 @@ out_uri_auth_compat:
|
|||||||
global.tune.max_http_hdr * sizeof(struct hdr_idx_elem),
|
global.tune.max_http_hdr * sizeof(struct hdr_idx_elem),
|
||||||
MEM_F_SHARED);
|
MEM_F_SHARED);
|
||||||
|
|
||||||
|
list_for_each_entry(curr_resolvers, &dns_resolvers, list) {
|
||||||
|
if (LIST_ISEMPTY(&curr_resolvers->nameservers)) {
|
||||||
|
ha_warning("config : resolvers '%s' [%s:%d] has no nameservers configured!\n",
|
||||||
|
curr_resolvers->id, curr_resolvers->conf.file,
|
||||||
|
curr_resolvers->conf.line);
|
||||||
|
err_code |= ERR_WARN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list_for_each_entry(postparser, &postparsers, list) {
|
list_for_each_entry(postparser, &postparsers, list) {
|
||||||
if (postparser->func)
|
if (postparser->func)
|
||||||
cfgerr += postparser->func();
|
cfgerr += postparser->func();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user