Repository navigation
Expect an error for IPv4-mapped IPv6 equality in network_ext tests - #535
Merged
Merged
Conversation
This was referenced Oct 21, 2026
l46kok
reviewed
Oct 22, 2026
| } | ||
| test { | ||
| name: "ipv4_not_equals_ipv6" | ||
| expr: "ip('::ffff:c0a8:1') == ip('192.168.10.1')" |
Collaborator
There was a problem hiding this comment.
Since this test case is identical to above, could we change this to test a genuine cross-family IPv4 vs IPv6 inequality? e.g: ip('192.168.0.1') == ip('2001:db8::1') -> false
| @@ -183,12 +183,20 @@ section { | |||
| test { | |||
| name: "ipv4_equals_ipv6" | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| name: "ipv4_equals_ipv6" | |
| name: "invalid_ipv4_equals_ipv6" |
…lity Signed-off-by: doxxx93 <doxxx93@gmail.com>
Contributor
Author
|
Applied both: renamed the mapped case to |
Collaborator
|
/gcbrun |
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.
ipv4_equals_ipv6andipv4_not_equals_ipv6needip('::ffff:c0a8:1')to parse, but that is the same IPv4-mapped address as::ffff:192.168.0.1, whichparse_invalid_ipv4_in_ipv6in the same file expects to fail. cel-go v0.32.0 withext.Network()errors on both expressions (IPv4-mapped IPv6 address "::ffff:c0a8:1" is not allowed), as does the Kubernetes library it came from (Is4In6()inparseIPAddr, staging/src/k8s.io/apiserver/pkg/cel/library/ip.go).This changes the mapped-address case, now
invalid_ipv4_equals_ipv6, to the same eval error asparse_invalid_ipv4_in_ipv6, and turnsipv4_not_equals_ipv6into a genuine cross-family comparison,ip('192.168.0.1') == ip('2001:db8::1')-> false. The question of comparing addresses by their 16-byte form was raised in #507 (comment) and looks like it was left open. If that is the intended direction instead,parse_invalid_ipv4_in_ipv6and cel-go's parsing would need to change with it.Found while implementing the network extension in cel-rust, which runs this file in its conformance suite.