From 186f9f5dcfff5fa9d341c71c10cc1d572a6388fb Mon Sep 17 00:00:00 2001
From: nvima
Date: Sun, 26 Nov 2023 19:44:26 +0100
Subject: [PATCH] upstream: added ipv6 dns result priorization option
Signed-off-by: nvima
---
src/flb_upstream.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
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);