[release/1.7 backport] Fix ip_pref configuration option#11223
Merged
dmcgowan merged 2 commits intocontainerd:release/1.7from Jan 7, 2025
Merged
[release/1.7 backport] Fix ip_pref configuration option#11223dmcgowan merged 2 commits intocontainerd:release/1.7from
ip_pref configuration option#11223dmcgowan merged 2 commits intocontainerd:release/1.7from
Conversation
The ip.To16() function returns non-nil if `ip` is any kind of IP address, including IPv4. To look for IPv6 specifically, use ip.To4() == nil. Signed-off-by: Sam Edwards <[email protected]> (cherry picked from commit 88a8496) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sam Edwards <[email protected]> (cherry picked from commit f77185f) Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah
commented
Jan 6, 2025
Comment on lines
137
to
+138
| "ipv6 should be picked even if ipv4 comes first": { | ||
| ips: []string{"2001:db8:85a3::8a2e:370:7334", "192.168.17.43"}, | ||
| ips: []string{"192.168.17.43", "2001:db8:85a3::8a2e:370:7334"}, |
Member
Author
There was a problem hiding this comment.
Minor conflict in the tests in adjacent lines because main rewrote these to table-tests using a slice instead of a map.
mxpv
approved these changes
Jan 6, 2025
dmcgowan
approved these changes
Jan 7, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ip_prefconfiguration option #9076