Skip to content

Commit

Permalink
upstream: added ipv6 dns result priorization option
Browse files Browse the repository at this point in the history
Signed-off-by: nvima <[email protected]>
  • Loading branch information
nvima authored and pwhelan committed Jan 16, 2024
1 parent e9f08d0 commit 186f9f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/flb_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 186f9f5

Please sign in to comment.