-
Notifications
You must be signed in to change notification settings - Fork 5.5k
listener: fix ipv6 error #3912
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
listener: fix ipv6 error #3912
Changes from 2 commits
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 |
|---|---|---|
|
|
@@ -380,11 +380,14 @@ void ListenerImpl::convertDestinationIPsMapToTrie() { | |
| for (const auto& entry : destination_ips_map) { | ||
| std::vector<Network::Address::CidrRange> subnets; | ||
| if (entry.first == EMPTY_STRING) { | ||
| list.push_back( | ||
| std::make_pair<ServerNamesMapSharedPtr, std::vector<Network::Address::CidrRange>>( | ||
| std::make_shared<ServerNamesMap>(entry.second), | ||
| {Network::Address::CidrRange::create("0.0.0.0/0"), | ||
| Network::Address::CidrRange::create("::/0")})); | ||
| std::vector<Network::Address::CidrRange> cidr_ranges; | ||
| if (Network::Address::ipFamilySupported(AF_INET)) { | ||
| cidr_ranges.push_back(Network::Address::CidrRange::create("0.0.0.0/0")); | ||
| } | ||
| if (Network::Address::ipFamilySupported(AF_INET6)) { | ||
| cidr_ranges.push_back(Network::Address::CidrRange::create("::/0")); | ||
| } | ||
| list.push_back({std::make_shared<ServerNamesMap>(entry.second), cidr_ranges}); | ||
|
Contributor
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. Could you use the patch I provided (using unused
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. Updated. Please check |
||
| } else { | ||
| list.push_back( | ||
| std::make_pair<ServerNamesMapSharedPtr, std::vector<Network::Address::CidrRange>>( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 think we need support IPv6-only setups as well:
(diff against
masterbranch, since it's more readable)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.
cc @ggreenway
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 agree with @PiotrSikora