Skip to content

correctly store origin dst addr in map_of_dst_info at ipv4-mapped ipv…#765

Merged
kmesh-bot merged 1 commit intokmesh-net:mainfrom
kwb0523:main
Aug 28, 2024
Merged

correctly store origin dst addr in map_of_dst_info at ipv4-mapped ipv…#765
kmesh-bot merged 1 commit intokmesh-net:mainfrom
kwb0523:main

Conversation

@kwb0523
Copy link
Copy Markdown
Contributor

@kwb0523 kwb0523 commented Aug 23, 2024

…6 scene

What type of PR is this?
/kind bug

What this PR does / why we need it:
In waypoint_manager func, the ipv6 addr in kmesh_ctx->orig_dst_addr.ip6 is reversed to ipv4 format, and this format of ipv6 address inapplicable for later waypoint processing, it need store the origin dst addr directly.

Which issue(s) this PR fixes:
Fixes #756

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@kwb0523
Copy link
Copy Markdown
Contributor Author

kwb0523 commented Aug 23, 2024

/retest

@YaoZengzeng
Copy link
Copy Markdown
Member

Kmesh daemon will fail to restart:

root@kurator-linux-0002:~/kmesh# kklp kmesh-8ktvh 
none on /sys/fs/bpf type bpf (rw,relatime)
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --bpf-fs-path=\"/sys/fs/bpf\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --cgroup2-path=\"/mnt/kmesh_cgroup2\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --cni-etc-path=\"/etc/cni/net.d\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --conflist-name=\"\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --enable-bpf-log=\"true\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --enable-bypass=\"false\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --enable-mda=\"false\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --enable-secret-manager=\"false\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --help=\"false\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --mode=\"workload\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="FLAG: --plugin-cni-chained=\"true\"" subsys=manager
time="2024-08-23T07:22:17Z" level=info msg="oldGitVersion: 2800172400 newGitVersion: 2800172400" subsys=pkg/bpf
time="2024-08-23T07:22:17Z" level=info msg="kmesh start with Restart, load bpf maps and prog from last" subsys=pkg/bpf
time="2024-08-23T07:22:17Z" level=info msg="kmesh restart, not clean bpf map and prog" subsys=pkg/bpf
Error: bpf Load failed, field CgroupConnect4Prog: program cgroup_connect4_prog: load program: permission denied: 404: (7b) *(u64 *)(r10 -56) = r1: 405: (79) r6 = * (truncated, 278 line(s) omitted)
time="2024-08-23T07:22:17Z" level=error msg="bpf Load failed, field CgroupConnect4Prog: program cgroup_connect4_prog: load program: permission denied: 404: (7b) *(u64 *)(r10 -56) = r1: 405: (79) r6 = * (truncated, 278 line(s) omitted)" subsys=main
kmesh exit

@lec-bit
Copy link
Copy Markdown
Contributor

lec-bit commented Aug 23, 2024

/retest

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.09%. Comparing base (24ba1d1) to head (a941af1).
Report is 46 commits behind head on main.

see 7 files 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 a09130b...a941af1. Read the comment docs.

value_tuple.ipv4.daddr = kmesh_ctx->orig_dst_addr.ip4;
value_tuple.ipv4.dport = ctx->user_port;
} else if (ctx->family == AF_INET6) {
if (!is_ipv4_mapped_addr(kmesh_ctx->orig_dst_addr.ip6))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The return type is of type bool, so remove "!"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how can waypoint process ipv6(v4 mapped format)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

waypoint could correctly handle pure ipv4, pure ipv6 and ipv4-mapped ipv6 address, ref: https://github.com/envoyproxy/envoy/blob/main/source/common/network/address_impl.cc#L87

As long as the address encoded in tlv is valid.

Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

Should add an e2e test with bookinfo example and add namespace waypoint for each service

@YaoZengzeng
Copy link
Copy Markdown
Member

Should add an e2e test with bookinfo example and add namespace waypoint for each service

ref: #766

…6 scene

Signed-off-by: kwb0523 <kwb0523@163.com>
@YaoZengzeng
Copy link
Copy Markdown
Member

/lgtm

@kmesh-bot kmesh-bot added the lgtm label Aug 28, 2024
@hzxuzhonghu hzxuzhonghu added the kind/bug Something isn't working label Aug 28, 2024
@hzxuzhonghu
Copy link
Copy Markdown
Member

/cherry-pick release-0.4

/approve

@kmesh-bot
Copy link
Copy Markdown
Collaborator

@hzxuzhonghu: once the present PR merges, I will cherry-pick it on top of release-0.4 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-0.4

/approve

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

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

The pull request process is described 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

@kmesh-bot kmesh-bot merged commit 518a35e into kmesh-net:main Aug 28, 2024
@kmesh-bot
Copy link
Copy Markdown
Collaborator

@hzxuzhonghu: new pull request created: #785

Details

In response to this:

/cherry-pick release-0.4

/approve

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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.

waypoint failed to process ipv4-mapped ipv6 connections

5 participants