-
Notifications
You must be signed in to change notification settings - Fork 5.5k
listener: Use v4-mapped addressing consistently. #2572
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0816aa3
listener: Test for v4-mapped addressing consistency.
jrajahalme 59b1077
listener: Use v4-mapped addressing consistently.
jrajahalme 3d8e281
Review update.
jrajahalme c23d305
Review fixes.
jrajahalme 659a3aa
Review fixes.
jrajahalme 0acec79
Fix format.
jrajahalme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,9 +73,13 @@ Address::InstanceConstSharedPtr getCanonicalLoopbackAddress(const Address::IpVer | |
| /** | ||
| * Returns the any address for the specified IP version. | ||
| * @param version the IP version of the any address. | ||
| * @param v4_compat determines whether a v4-mapped addresses bound to a socket listening on the | ||
| * returned ANY address are to be treated as IPv4 or IPv6 addresses. Defaults to 'false', | ||
| * has no effect with IPv4 ANY address. | ||
| * @returns the any address for the specified IP version. | ||
| */ | ||
| Address::InstanceConstSharedPtr getAnyAddress(const Address::IpVersion version); | ||
| Address::InstanceConstSharedPtr getAnyAddress(const Address::IpVersion version, | ||
| bool v4_compat = false); | ||
|
Member
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. Document v4_compat, please.
Contributor
Author
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. OK. |
||
|
|
||
| /** | ||
| * This function tries to create a socket of type IpVersion version and bind to it. If | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'd like a comment here (or at the top of the test) briefly explaining the circumstances this is testing.
It's confusing to me since this is the only place that leads to invoking Network::Utility::getAnyIpv6Address(false), so is this code testing a case that cannot occur outside of tests?
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 test mocks a case where a listener would be configured with an IPv6 any address and have it's
socket_addressconfigured withipv4_compat = true. There are a couple of tests that do that, but in those the socket address comes from the listener configuraion, so they do not invoke Network::Utility::getAnyIpv6Address() at all. The effect is the same, though, when the listener is configured with the IPv6 ANY address ([::]).