Skip to content

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

@wxnzb

Description

@wxnzb

What happened:
In bpf/kmesh/service/service.c, the current logic in service_manager() only checks for IPv4 waypoint:
if (service_v->wp_addr.ip4 != 0 && service_v->waypoint_port != 0)
This causes all IPv6 traffic to not be routed through the waypoint, even when a valid IPv6 wp_addr and waypoint_port are configured.

What you expected to happen:
IPv6 traffic should also be routed through the waypoint if a valid IPv6 address and port are configured in the service entry.
How to reproduce it (as minimally and precisely as possible):
Proposed fix:

Add IPv6 address check explicitly:
if ((service_v->wp_addr.ip4 != 0 && service_v->waypoint_port != 0) ||
((service_v->wp_addr.ip6[0] != 0 || service_v->wp_addr.ip6[1] != 0 ||
service_v->wp_addr.ip6[2] != 0 || service_v->wp_addr.ip6[3] != 0) &&
service_v->waypoint_port != 0)) {
...
}
Anything else we need to know?:

Environment:

  • Kmesh version:
  • Kmesh mode(kmesh has Kernel-Native Mode and Duel-Engine Mode):
  • Istio version:
  • Kernel version:
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions