Skip to content

[release/1.7 backport] Fix ip_pref configuration option#11223

Merged
dmcgowan merged 2 commits intocontainerd:release/1.7from
thaJeztah:1.7_backport_fix-ipv6-pref
Jan 7, 2025
Merged

[release/1.7 backport] Fix ip_pref configuration option#11223
dmcgowan merged 2 commits intocontainerd:release/1.7from
thaJeztah:1.7_backport_fix-ipv6-pref

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

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]>
@dosubot dosubot bot added area/cri Container Runtime Interface (CRI) kind/bug labels 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"},
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor conflict in the tests in adjacent lines because main rewrote these to table-tests using a slice instead of a map.

@dmcgowan dmcgowan merged commit 1079d92 into containerd:release/1.7 Jan 7, 2025
@thaJeztah thaJeztah deleted the 1.7_backport_fix-ipv6-pref branch January 7, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants