-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
dns: add a getaddrinfo based system resolver #22080
Conversation
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Not quite finished but I want to see what problems CI gives me. |
addrinfo hints; | ||
memset(&hints, 0, sizeof(hints)); | ||
hints.ai_flags = AI_ADDRCONFIG; | ||
hints.ai_family = AF_UNSPEC; | ||
// If we don't specify a socket type, every address will appear twice, once | ||
// for SOCK_STREAM and one for SOCK_DGRAM. Since we do not return the family | ||
// anyway, just pick one. | ||
hints.ai_socktype = SOCK_STREAM; |
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.
This is copied from the Android OS implementation.
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
1450040
to
e093217
Compare
This can be used when using the system resolver is desired. For example, on Android. Signed-off-by: Matt Klein <mklein@lyft.com>
e093217
to
69eb66d
Compare
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
OK I think this is ready. |
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.
Looks like coverage isn't happy but here's some first ass comments while you sort that :-)
/wait
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
Unfortunately the coverage tool is missing braces so there isn't much I can do about this. I will drop the limit: |
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.
/lgtm api
Signed-off-by: Matt Klein <mklein@lyft.com>
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.
Other than a few nits, this looks great (not surprisingly).
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Matt Klein <mklein@lyft.com>
source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc
Outdated
Show resolved
Hide resolved
/retest |
Retrying Azure Pipelines: |
/retest |
Retrying Azure Pipelines: |
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.
LGTM, thanks
api/envoy/extensions/network/dns_resolver/getaddrinfo/v3/getaddrinfo_dns_resolver.proto
Outdated
Show resolved
Hide resolved
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.
Just the one testing nit and you're good to go. Thanks!
test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc
Show resolved
Hide resolved
Signed-off-by: Matt Klein <mklein@lyft.com>
For non-Apple platforms like Linux and Android. Updated the Kotlin, Java & C++ builders. Added here: envoyproxy/envoy#22080 Signed-off-by: JP Simard <jp@jpsim.com>
For non-Apple platforms like Linux and Android. Updated the Kotlin, Java & C++ builders. Added here: envoyproxy/envoy#22080 Risk Level: Low to moderate, off by default but I had to refactor some stuff. Testing: Added. Docs Changes: Documentation comments. Release Notes: Added. Signed-off-by: JP Simard <jp@jpsim.com>
For non-Apple platforms like Linux and Android. Updated the Kotlin, Java & C++ builders. Added here: #22080 Risk Level: Low to moderate, off by default but I had to refactor some stuff. Testing: Added. Docs Changes: Documentation comments. Release Notes: Added. Signed-off-by: JP Simard <jp@jpsim.com>
This can be used when using the system resolver is desired. For
example, on Android.
Risk Level: None, new extension
Testing: New tests
Docs Changes: Added
Release Notes: Added
Platform Specific Features: TBD