Skip to content

fix: add IPv6 address check to service_manager for waypoint routing#1572

Open
shivansh-gohem wants to merge 1 commit intokmesh-net:mainfrom
shivansh-gohem:fix/1460-ipv6-waypoint
Open

fix: add IPv6 address check to service_manager for waypoint routing#1572
shivansh-gohem wants to merge 1 commit intokmesh-net:mainfrom
shivansh-gohem:fix/1460-ipv6-waypoint

Conversation

@shivansh-gohem
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR updates the service_manager function in the eBPF data plane to support IPv6 waypoint routing.

Previously, the service_manager logic only checked if service_v->wp_addr.ip4 != 0. This caused services with valid IPv6 waypoint addresses to be ignored and bypass the proxy.

This fix introduces a check for the ip6 array to ensure that if either an IPv4 or IPv6 address is present, the traffic is correctly routed to the waypoint manager.

Which issue this PR fixes:
Fixes #1460

Special notes for the reviewer:
The change is located in bpf/kmesh/workload/include/service.h.
I modified the conditional check to verify if any of the 4 segments of the IPv6 address are non-zero.

@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Jan 20, 2026
@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @shivansh-gohem, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical bug in the eBPF data plane's service_manager that previously failed to recognize and route traffic for services using IPv6 waypoint addresses. By extending the conditional logic to explicitly check for the presence of an IPv6 address, the change guarantees that all waypoint-enabled services, regardless of their IP version, are correctly processed by the proxy, thereby maintaining intended traffic flow and security policies.

Highlights

  • IPv6 Waypoint Routing Fix: The pull request addresses a bug where the service_manager in the eBPF data plane did not correctly handle IPv6 waypoint addresses, causing traffic to bypass the proxy.
  • Enhanced Address Check: The service_manager function has been updated to include a check for IPv6 waypoint addresses, alongside the existing IPv4 check, ensuring proper routing for both.
  • Impact on Service Routing: This change ensures that services configured with valid IPv6 waypoint addresses are now correctly recognized and routed through the waypoint manager, preventing unintended traffic bypasses.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


IPv6 unseen, Proxy bypass, now it's fixed, Traffic flows anew.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly extends waypoint routing to support IPv6 by adding a check for IPv6 addresses in service_manager. The implementation is functional, but the condition can be simplified for better readability and efficiency. I've provided a suggestion to make the check more concise by using 64-bit comparisons and removing a redundant check.

Signed-off-by: Shivansh Sahu <sahushivansh142@gmail.com>
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.57%. Comparing base (3018401) to head (5418532).
⚠️ Report is 1 commits behind head on main.
see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c77714...5418532. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shivansh-gohem
Copy link
Contributor Author

/cc @LiZhenCheng9527 @hzxuzhonghu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

service_manager() in service.h lacks IPv6 waypoint check, causes IPv6 traffic to skip proxy

2 participants