Skip to content
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

Fix route for IPv6 ClusterIPs #4297

Merged
merged 1 commit into from
Oct 14, 2022
Merged

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Oct 14, 2022

The util function commonPrefixLen returns at most 64 bits prefix length, which leads to the calculated CIDR for IPv6 ClusterIPs being larger than actual value. For example, "aabb:ccdd::1" and "aabb:ccdd::2" should get "aabb:ccdd::/126" but got "aabb:ccdd::/64". The patch removes the 64 bits limit and changes the function name to longestCommonPrefixLen.

Signed-off-by: Quan Tian [email protected]

The util function commonPrefixLen returns at most 64 bits prefix length,
which leads to the calculated CIDR for IPv6 ClusterIPs being larger than
actual value. For example, "aabb:ccdd::1" and "aabb:ccdd::2" should get
"aabb:ccdd::/126" but got "aabb:ccdd::/64". The patch removes the 64
bits limit and changes the function name to longestCommonPrefixLen.

Signed-off-by: Quan Tian <[email protected]>
@tnqn tnqn added kind/bug Categorizes issue or PR as related to a bug. area/proxy Issues or PRs related to proxy functions in Antrea action/release-note Indicates a PR that should be included in release notes. labels Oct 14, 2022
@tnqn tnqn requested a review from hongliangl October 14, 2022 04:56
Copy link
Contributor

@hongliangl hongliangl left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Oct 14, 2022

Codecov Report

Merging #4297 (079d4f4) into main (6c53afc) will decrease coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4297      +/-   ##
==========================================
- Coverage   63.18%   63.01%   -0.18%     
==========================================
  Files         388      388              
  Lines       55229    55145      -84     
==========================================
- Hits        34898    34747     -151     
- Misses      17749    17831      +82     
+ Partials     2582     2567      -15     
Flag Coverage Δ
integration-tests 34.47% <0.00%> (-1.72%) ⬇️
kind-e2e-tests 48.16% <100.00%> (-0.11%) ⬇️
unit-tests 45.01% <100.00%> (-1.21%) ⬇️
Impacted Files Coverage Δ
pkg/agent/util/net.go 56.65% <100.00%> (+3.09%) ⬆️
pkg/agent/cniserver/ipam/antrea_ipam.go 52.81% <0.00%> (-22.95%) ⬇️
pkg/agent/flowexporter/exporter/certificate.go 27.77% <0.00%> (-22.23%) ⬇️
pkg/agent/controller/networkpolicy/packetin.go 58.78% <0.00%> (-15.55%) ⬇️
pkg/agent/cniserver/ipam/ipam_service.go 76.40% <0.00%> (-12.36%) ⬇️
...g/agent/controller/serviceexternalip/controller.go 69.62% <0.00%> (-11.95%) ⬇️
pkg/agent/proxy/topology.go 72.72% <0.00%> (-9.10%) ⬇️
pkg/agent/cniserver/server.go 74.34% <0.00%> (-3.41%) ⬇️
pkg/agent/agent.go 53.06% <0.00%> (-3.11%) ⬇️
pkg/agent/ipassigner/local_ip_detector_linux.go 75.75% <0.00%> (-3.04%) ⬇️
... and 30 more

@tnqn
Copy link
Member Author

tnqn commented Oct 14, 2022

/skip-all

@tnqn tnqn merged commit b2ba248 into antrea-io:main Oct 14, 2022
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
The util function commonPrefixLen returns at most 64 bits prefix length,
which leads to the calculated CIDR for IPv6 ClusterIPs being larger than
actual value. For example, "aabb:ccdd::1" and "aabb:ccdd::2" should get
"aabb:ccdd::/126" but got "aabb:ccdd::/64". The patch removes the 64
bits limit and changes the function name to longestCommonPrefixLen.

Signed-off-by: Quan Tian <[email protected]>
@tnqn tnqn deleted the fix-ipv6-clusterip-route branch March 30, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. area/proxy Issues or PRs related to proxy functions in Antrea kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants