-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quic: support for server-preferred address behind DNAT #33774
Changes from all commits
7ca7daf
78abeb1
bb84625
e25ccb4
93f21e6
b8a812b
b54cc44
2a1b89c
b21946f
6eb2c6c
f006088
19c2d66
cf30494
c7bf130
81b10a2
9c8cfba
d8adc70
59ded87
8c7e972
155e2ef
40d2ab5
81241b7
39ca689
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,14 +15,29 @@ class EnvoyQuicServerPreferredAddressConfig { | |
public: | ||
virtual ~EnvoyQuicServerPreferredAddressConfig() = default; | ||
|
||
// The set of addresses used to configure the server preferred addresses. | ||
struct Addresses { | ||
// Addresses that client is requested to use. | ||
quic::QuicSocketAddress ipv4_; | ||
quic::QuicSocketAddress ipv6_; | ||
|
||
// If destination NAT is applied between the client and Envoy, the addresses that | ||
// Envoy will see for client traffic to the server preferred address. If this is not | ||
// set, Envoy will expect to receive server preferred address traffic on the above addresses. | ||
// | ||
// A DNAT address will be ignored if the corresponding SPA address is not set. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is super clear. Thanks! |
||
quic::QuicSocketAddress dnat_ipv4_; | ||
quic::QuicSocketAddress dnat_ipv6_; | ||
}; | ||
|
||
/** | ||
* Called during config loading. | ||
* @param local_address the configured default listening address. | ||
* Returns a pair of the server preferred addresses in form of {IPv4, IPv6} which will be used for | ||
* the entire life time of the QUIC listener. An uninitialized address value means no preferred | ||
* address for that address family. | ||
*/ | ||
virtual std::pair<quic::QuicSocketAddress, quic::QuicSocketAddress> | ||
virtual Addresses | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this interface needs to be changed? And why the proto struct is more preferrable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it is now returning 4 addresses instead of two. And a |
||
getServerPreferredAddresses(const Network::Address::InstanceConstSharedPtr& local_address) PURE; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_package", | ||
) | ||
load( | ||
"//test/extensions:extensions_build_system.bzl", | ||
"envoy_extension_cc_test", | ||
) | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
envoy_package() | ||
|
||
envoy_extension_cc_test( | ||
name = "fixed_server_preferred_address_test", | ||
srcs = ["fixed_server_preferred_address_test.cc"], | ||
extension_names = ["envoy.quic.server_preferred_address.fixed"], | ||
tags = ["nofips"], | ||
deps = [ | ||
"//source/extensions/quic/server_preferred_address:fixed_server_preferred_address_config_lib", | ||
"//test/mocks/protobuf:protobuf_mocks", | ||
], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Brief comment, please.