diff --git a/src/flb_upstream.c b/src/flb_upstream.c index d2924bed768..c172245813c 100644 --- a/src/flb_upstream.c +++ b/src/flb_upstream.c @@ -53,6 +53,12 @@ struct flb_config_map upstream_net[] = { "Prioritize IPv4 DNS results when trying to establish a connection" }, + { + FLB_CONFIG_MAP_BOOL, "net.dns.prefer_ipv6", "false", + 0, FLB_TRUE, offsetof(struct flb_net_setup, dns_prefer_ipv6), + "Prioritize IPv6 DNS results when trying to establish a connection" + }, + { FLB_CONFIG_MAP_BOOL, "net.keepalive", "true", 0, FLB_TRUE, offsetof(struct flb_net_setup, keepalive), @@ -165,6 +171,12 @@ struct mk_list *flb_upstream_get_config_map(struct flb_config *config) upstream_net[config_index].def_value = "true"; } } + if (config->dns_prefer_ipv6) { + if (strcmp(upstream_net[config_index].name, + "net.dns.prefer_ipv6") == 0) { + upstream_net[config_index].def_value = "true"; + } + } } config_map = flb_config_map_create(config, upstream_net);