Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions docs/root/api/starting_envoy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,17 @@ for further information.
builder.addDNSFallbackNameservers(listOf<String>("8.8.8.8"))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``enableDNSFilterUnroutableFamilies``
``includeUnroutableDNSResults``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. attention::

This API is only available for Kotlin.

Specify whether to filter unroutable IP families during DNS resolution or not.
See `the Envoy docs <https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.proto#extensions-network-dns-resolver-cares-v3-caresdnsresolverconfig>`__
Specify whether to include unroutable IP families during DNS resolution or not.
See the Envoy docs for
`c-ares <https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.proto#extensions-network-dns-resolver-cares-v3-caresdnsresolverconfig>`__ &
`Apple <https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/network/dns_resolver/apple/v3/apple_dns_resolver.proto#extensions-network-dns-resolver-apple-v3-applednsresolverconfig>`__
for further information.

// Kotlin
builder.enableDNSFilterUnroutableFamilies(true)
// Kotlin & Swift
builder.includeUnroutableDNSResults(true)

~~~~~~~~~~~~~~~
``addLogLevel``
Expand Down
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 97 files
+1 −0 .bazelrc
+2 −0 CODEOWNERS
+1 −0 api/BUILD
+1 −1 api/envoy/config/accesslog/v3/accesslog.proto
+12 −0 api/envoy/extensions/common/async_files/v3/BUILD
+41 −0 api/envoy/extensions/common/async_files/v3/async_file_manager.proto
+5 −1 api/envoy/extensions/filters/network/thrift_proxy/v3/route.proto
+8 −0 api/envoy/extensions/network/dns_resolver/apple/v3/apple_dns_resolver.proto
+1 −0 api/versioning/BUILD
+7 −0 bazel/README.md
+1 −1 contrib/sip_proxy/filters/network/source/config.cc
+1 −0 docs/root/api-v3/common_messages/common_messages.rst
+1 −56 docs/root/version_history/current.rst
+10 −0 envoy/http/header_map.h
+1 −1 envoy/server/admin.h
+1 −1 source/common/filter/config_discovery_impl.h
+11 −1 source/common/http/header_map_impl.cc
+1 −1 source/common/rds/rds_route_config_subscription.h
+4 −4 source/common/router/config_impl.h
+1 −1 source/common/router/scoped_rds.h
+1 −1 source/common/router/vhds.h
+1 −1 source/common/runtime/runtime_impl.h
+1 −1 source/common/secret/sds_api.h
+112 −40 source/common/stats/thread_local_store.cc
+83 −67 source/common/stats/thread_local_store.h
+1 −1 source/common/tcp_proxy/tcp_proxy.h
+1 −1 source/common/upstream/cds_api_impl.h
+2 −2 source/common/upstream/cluster_factory_impl.cc
+3 −3 source/common/upstream/cluster_factory_impl.h
+2 −2 source/common/upstream/eds.cc
+2 −2 source/common/upstream/eds.h
+1 −1 source/common/upstream/health_discovery_service.cc
+1 −1 source/common/upstream/leds.h
+2 −2 source/common/upstream/load_balancer_impl.cc
+2 −2 source/common/upstream/logical_dns_cluster.cc
+2 −2 source/common/upstream/logical_dns_cluster.h
+1 −1 source/common/upstream/maglev_lb.h
+1 −1 source/common/upstream/od_cds_api_impl.h
+2 −2 source/common/upstream/original_dst_cluster.cc
+2 −2 source/common/upstream/original_dst_cluster.h
+1 −1 source/common/upstream/ring_hash_lb.h
+2 −2 source/common/upstream/static_cluster.cc
+2 −2 source/common/upstream/static_cluster.h
+2 −2 source/common/upstream/strict_dns_cluster.cc
+2 −2 source/common/upstream/strict_dns_cluster.h
+3 −3 source/common/upstream/upstream_impl.cc
+3 −3 source/common/upstream/upstream_impl.h
+83 −0 source/extensions/common/async_files/BUILD
+65 −0 source/extensions/common/async_files/README.md
+26 −0 source/extensions/common/async_files/async_file_action.cc
+99 −0 source/extensions/common/async_files/async_file_action.h
+27 −0 source/extensions/common/async_files/async_file_context_base.cc
+38 −0 source/extensions/common/async_files/async_file_context_base.h
+225 −0 source/extensions/common/async_files/async_file_context_thread_pool.cc
+51 −0 source/extensions/common/async_files/async_file_context_thread_pool.h
+76 −0 source/extensions/common/async_files/async_file_handle.h
+31 −0 source/extensions/common/async_files/async_file_manager.cc
+96 −0 source/extensions/common/async_files/async_file_manager.h
+78 −0 source/extensions/common/async_files/async_file_manager_factory.cc
+37 −0 source/extensions/common/async_files/async_file_manager_factory.h
+256 −0 source/extensions/common/async_files/async_file_manager_thread_pool.cc
+71 −0 source/extensions/common/async_files/async_file_manager_thread_pool.h
+65 −0 source/extensions/common/async_files/status_after_file_error.cc
+21 −0 source/extensions/common/async_files/status_after_file_error.h
+22 −9 source/extensions/network/dns_resolver/apple/apple_dns_impl.cc
+8 −3 source/extensions/network/dns_resolver/apple/apple_dns_impl.h
+117 −0 test/common/http/http2/codec_impl_test.cc
+44 −18 test/common/stats/thread_local_store_test.cc
+1 −1 test/common/stats/utility_fuzz_test.cc
+1 −1 test/common/upstream/cluster_factory_impl_test.cc
+1 −1 test/common/upstream/eds_speed_test.cc
+1 −1 test/common/upstream/eds_test.cc
+2 −2 test/common/upstream/hds_test.cc
+1 −1 test/common/upstream/leds_test.cc
+1 −1 test/common/upstream/logical_dns_cluster_test.cc
+1 −1 test/common/upstream/original_dst_cluster_test.cc
+1 −1 test/common/upstream/subset_lb_test.cc
+1 −1 test/common/upstream/transport_socket_matcher_test.cc
+39 −39 test/common/upstream/upstream_impl_test.cc
+62 −0 test/extensions/common/async_files/BUILD
+450 −0 test/extensions/common/async_files/async_file_handle_thread_pool_test.cc
+87 −0 test/extensions/common/async_files/async_file_manager_factory_test.cc
+311 −0 test/extensions/common/async_files/async_file_manager_thread_pool_test.cc
+297 −0 test/extensions/common/async_files/async_file_manager_thread_pool_with_mocks_test.cc
+42 −0 test/extensions/common/async_files/status_after_file_error_test.cc
+54 −1 test/extensions/network/dns_resolver/apple/apple_dns_impl_test.cc
+2 −2 test/integration/clusters/custom_static_cluster.h
+1 −1 test/integration/fake_upstream.h
+1 −1 test/mocks/server/admin.h
+1 −1 test/mocks/upstream/cluster_info.h
+2 −2 test/per_file_coverage.sh
+2 −0 test/server/admin/BUILD
+111 −0 test/server/admin/stats_handler_test.cc
+26 −9 test/test_common/real_threads_test_helper.cc
+12 −3 test/test_common/real_threads_test_helper.h
+1 −1 test/test_common/status_utility.h
+14 −0 tools/spelling/spelling_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public enum TrustChainVerification {
public final Integer dnsMinRefreshSeconds;
public final String dnsPreresolveHostnames;
public final List<String> dnsFallbackNameservers;
public final Boolean dnsFilterUnroutableFamilies;
public final Boolean includeUnroutableDNSResults;
public final Boolean enableHappyEyeballs;
public final Boolean enableInterfaceBinding;
public final Integer h2ConnectionKeepaliveIdleIntervalMilliseconds;
Expand Down Expand Up @@ -68,7 +68,7 @@ public enum TrustChainVerification {
* @param dnsMinRefreshSeconds minimum rate in seconds at which to refresh DNS.
* @param dnsPreresolveHostnames hostnames to preresolve on Envoy Client construction.
* @param dnsFallbackNameservers addresses to use as DNS name server fallback.
* @param dnsFilterUnroutableFamilies whether to filter unroutable IP families or not.
* @param includeUnroutableDNSResults whether to include unroutable IP families or not.
* @param enableHappyEyeballs whether to enable RFC 6555 handling for IPv4/IPv6.
* @param enableInterfaceBinding whether to allow interface binding.
* @param h2ConnectionKeepaliveIdleIntervalMilliseconds rate in milliseconds seconds to send h2
Expand All @@ -92,7 +92,7 @@ public EnvoyConfiguration(
int connectTimeoutSeconds, int dnsRefreshSeconds, int dnsFailureRefreshSecondsBase,
int dnsFailureRefreshSecondsMax, int dnsQueryTimeoutSeconds, int dnsMinRefreshSeconds,
String dnsPreresolveHostnames, List<String> dnsFallbackNameservers,
Boolean dnsFilterUnroutableFamilies, boolean enableHappyEyeballs,
Boolean includeUnroutableDNSResults, boolean enableHappyEyeballs,
boolean enableInterfaceBinding, int h2ConnectionKeepaliveIdleIntervalMilliseconds,
int h2ConnectionKeepaliveTimeoutSeconds, List<String> h2RawDomains, int maxConnectionsPerHost,
int statsFlushSeconds, int streamIdleTimeoutSeconds, int perTryIdleTimeoutSeconds,
Expand All @@ -111,7 +111,7 @@ public EnvoyConfiguration(
this.dnsMinRefreshSeconds = dnsMinRefreshSeconds;
this.dnsPreresolveHostnames = dnsPreresolveHostnames;
this.dnsFallbackNameservers = dnsFallbackNameservers;
this.dnsFilterUnroutableFamilies = dnsFilterUnroutableFamilies;
this.includeUnroutableDNSResults = includeUnroutableDNSResults;
this.enableHappyEyeballs = enableHappyEyeballs;
this.enableInterfaceBinding = enableInterfaceBinding;
this.h2ConnectionKeepaliveIdleIntervalMilliseconds =
Expand Down Expand Up @@ -191,7 +191,7 @@ String resolveTemplate(final String templateYAML, final String platformFilterTem
String dnsResolverConfig = String.format(
"{\"@type\":\"type.googleapis.com/envoy.extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig\",\"resolvers\":%s,\"use_resolvers_as_fallback\": %s, \"filter_unroutable_families\": %s}",
dnsFallbackNameserversAsString, !dnsFallbackNameservers.isEmpty() ? "true" : "false",
dnsFilterUnroutableFamilies ? "true" : "false");
includeUnroutableDNSResults ? "false" : "true");

StringBuilder configBuilder = new StringBuilder("!ignore platform_defs:\n");
configBuilder.append(String.format("- &connect_timeout %ss\n", connectTimeoutSeconds))
Expand Down
12 changes: 6 additions & 6 deletions library/kotlin/io/envoyproxy/envoymobile/EngineBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ open class EngineBuilder(
private var dnsFailureRefreshSecondsBase = 2
private var dnsFailureRefreshSecondsMax = 10
private var dnsFallbackNameservers = listOf<String>()
private var dnsFilterUnroutableFamilies = false
private var includeUnroutableDNSResults = false
private var dnsQueryTimeoutSeconds = 25
private var dnsMinRefreshSeconds = 60
private var dnsPreresolveHostnames = "[]"
Expand Down Expand Up @@ -186,14 +186,14 @@ open class EngineBuilder(
}

/**
* Specify whether to filter unroutable IP families during DNS resolution or not.
* Specify whether to include unroutable IP families during DNS resolution or not.
*
* @param dnsFilterUnroutableFamilies whether to filter or not.
* @param includeUnroutableDNSResults whether to include or not.
*
* @return this builder.
*/
fun enableDNSFilterUnroutableFamilies(dnsFilterUnroutableFamilies: Boolean): EngineBuilder {
this.dnsFilterUnroutableFamilies = dnsFilterUnroutableFamilies
fun includeUnroutableDNSResults(includeUnroutableDNSResults: Boolean): EngineBuilder {
this.includeUnroutableDNSResults = includeUnroutableDNSResults
return this
}

Expand Down Expand Up @@ -474,7 +474,7 @@ open class EngineBuilder(
dnsMinRefreshSeconds,
dnsPreresolveHostnames,
dnsFallbackNameservers,
dnsFilterUnroutableFamilies,
includeUnroutableDNSResults,
enableHappyEyeballs,
enableInterfaceBinding,
h2ConnectionKeepaliveIdleIntervalMilliseconds,
Expand Down
7 changes: 5 additions & 2 deletions library/objective-c/EnvoyConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ - (instancetype)initWithAdminInterfaceEnabled:(BOOL)adminInterfaceEnabled
enableHappyEyeballs:(BOOL)enableHappyEyeballs
enableInterfaceBinding:(BOOL)enableInterfaceBinding
enforceTrustChainVerification:(BOOL)enforceTrustChainVerification
includeUnroutableDNSResults:(BOOL)includeUnroutableDNSResults
h2ConnectionKeepaliveIdleIntervalMilliseconds:
(UInt32)h2ConnectionKeepaliveIdleIntervalMilliseconds
h2ConnectionKeepaliveTimeoutSeconds:(UInt32)h2ConnectionKeepaliveTimeoutSeconds
Expand Down Expand Up @@ -53,6 +54,7 @@ - (instancetype)initWithAdminInterfaceEnabled:(BOOL)adminInterfaceEnabled
self.enableHappyEyeballs = enableHappyEyeballs;
self.enableInterfaceBinding = enableInterfaceBinding;
self.enforceTrustChainVerification = enforceTrustChainVerification;
self.includeUnroutableDNSResults = includeUnroutableDNSResults;
self.h2ConnectionKeepaliveIdleIntervalMilliseconds =
h2ConnectionKeepaliveIdleIntervalMilliseconds;
self.h2ConnectionKeepaliveTimeoutSeconds = h2ConnectionKeepaliveTimeoutSeconds;
Expand Down Expand Up @@ -145,11 +147,12 @@ - (nullable NSString *)resolveTemplate:(NSString *)templateYAML {
self.enableHappyEyeballs ? @"true" : @"false"];
[definitions appendFormat:@"- &dns_refresh_rate %lus\n", (unsigned long)self.dnsRefreshSeconds];
[definitions appendFormat:@"- &dns_resolver_name envoy.network.dns_resolver.apple\n"];
// No additional values are currently needed for Apple-based DNS resolver.
[definitions
appendFormat:@"- &dns_resolver_config "
@"{\"@type\":\"type.googleapis.com/"
@"envoy.extensions.network.dns_resolver.apple.v3.AppleDnsResolverConfig\"}\n"];
@"envoy.extensions.network.dns_resolver.apple.v3.AppleDnsResolverConfig\", "
@"\"include_unroutable_families\": %@}\n",
self.includeUnroutableDNSResults ? @"true" : @"false"];
[definitions appendFormat:@"- &enable_interface_binding %@\n",
self.enableInterfaceBinding ? @"true" : @"false"];
[definitions appendFormat:@"- &trust_chain_verification %@\n", self.enforceTrustChainVerification
Expand Down
2 changes: 2 additions & 0 deletions library/objective-c/EnvoyEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ extern const int kEnvoyFilterResumeStatusResumeIteration;
@property (nonatomic, assign) BOOL enableHappyEyeballs;
@property (nonatomic, assign) BOOL enableInterfaceBinding;
@property (nonatomic, assign) BOOL enforceTrustChainVerification;
@property (nonatomic, assign) BOOL includeUnroutableDNSResults;
@property (nonatomic, assign) UInt32 h2ConnectionKeepaliveIdleIntervalMilliseconds;
@property (nonatomic, assign) UInt32 h2ConnectionKeepaliveTimeoutSeconds;
@property (nonatomic, strong) NSArray<NSString *> *h2RawDomains;
Expand Down Expand Up @@ -374,6 +375,7 @@ extern const int kEnvoyFilterResumeStatusResumeIteration;
enableHappyEyeballs:(BOOL)enableHappyEyeballs
enableInterfaceBinding:(BOOL)enableInterfaceBinding
enforceTrustChainVerification:(BOOL)enforceTrustChainVerification
includeUnroutableDNSResults:(BOOL)includeUnroutableDNSResults
h2ConnectionKeepaliveIdleIntervalMilliseconds:
(UInt32)h2ConnectionKeepaliveIdleIntervalMilliseconds
h2ConnectionKeepaliveTimeoutSeconds:(UInt32)h2ConnectionKeepaliveTimeoutSeconds
Expand Down
15 changes: 15 additions & 0 deletions library/swift/EngineBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ open class EngineBuilder: NSObject {
private var enableHappyEyeballs: Bool = false
private var enableInterfaceBinding: Bool = false
private var enforceTrustChainVerification: Bool = true
private var includeUnroutableDNSResults: Bool = false
private var h2ConnectionKeepaliveIdleIntervalMilliseconds: UInt32 = 100000000
private var h2ConnectionKeepaliveTimeoutSeconds: UInt32 = 10
private var h2RawDomains: [String] = []
Expand Down Expand Up @@ -186,6 +187,19 @@ open class EngineBuilder: NSObject {
return self
}

/// Specify whether DNS addresses that the system considers to be unroutable should still
/// be attempted.
///
/// - parameter includeUnroutableDNSResults: whether to include unroutable families of DNS
/// addresses.
///
/// - returns: This builder.
@discardableResult
public func includeUnroutableDNSResults(_ includeUnroutableDNSResults: Bool) -> Self {
self.includeUnroutableDNSResults = includeUnroutableDNSResults
return self
}

/// Add a rate at which to ping h2 connections on new stream creation if the connection has
/// sat idle.
///
Expand Down Expand Up @@ -430,6 +444,7 @@ open class EngineBuilder: NSObject {
enableHappyEyeballs: self.enableHappyEyeballs,
enableInterfaceBinding: self.enableInterfaceBinding,
enforceTrustChainVerification: self.enforceTrustChainVerification,
includeUnroutableDNSResults: self.includeUnroutableDNSResults,
h2ConnectionKeepaliveIdleIntervalMilliseconds:
self.h2ConnectionKeepaliveIdleIntervalMilliseconds,
h2ConnectionKeepaliveTimeoutSeconds: self.h2ConnectionKeepaliveTimeoutSeconds,
Expand Down
6 changes: 3 additions & 3 deletions test/kotlin/io/envoyproxy/envoymobile/EngineBuilderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ class EngineBuilderTest {
}

@Test
fun `specifying dns filter unroutable families overrides default`() {
fun `specifying dns include unroutable families overrides default`() {
engineBuilder = EngineBuilder(Standard())
engineBuilder.addEngineType { envoyEngine }
engineBuilder.enableDNSFilterUnroutableFamilies(true)
engineBuilder.includeUnroutableDNSResults(true)

val engine = engineBuilder.build() as EngineImpl
assertThat(engine.envoyConfiguration!!.dnsFilterUnroutableFamilies).isTrue()
assertThat(engine.envoyConfiguration!!.includeUnroutableDNSResults).isTrue()
}

@Test
Expand Down
3 changes: 3 additions & 0 deletions test/swift/EngineBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ final class EngineBuilderTests: XCTestCase {
enableHappyEyeballs: true,
enableInterfaceBinding: true,
enforceTrustChainVerification: false,
includeUnroutableDNSResults: true,
h2ConnectionKeepaliveIdleIntervalMilliseconds: 1,
h2ConnectionKeepaliveTimeoutSeconds: 333,
h2RawDomains: ["h2-raw.domain"],
Expand Down Expand Up @@ -494,6 +495,7 @@ final class EngineBuilderTests: XCTestCase {
enableHappyEyeballs: false,
enableInterfaceBinding: false,
enforceTrustChainVerification: true,
includeUnroutableDNSResults: false,
h2ConnectionKeepaliveIdleIntervalMilliseconds: 1,
h2ConnectionKeepaliveTimeoutSeconds: 333,
h2RawDomains: [],
Expand Down Expand Up @@ -535,6 +537,7 @@ final class EngineBuilderTests: XCTestCase {
enableHappyEyeballs: false,
enableInterfaceBinding: false,
enforceTrustChainVerification: true,
includeUnroutableDNSResults: false,
h2ConnectionKeepaliveIdleIntervalMilliseconds: 222,
h2ConnectionKeepaliveTimeoutSeconds: 333,
h2RawDomains: [],
Expand Down