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

Unify bpf_sock_tuple constructtion in tcp probe and sockops auth report #1032

Open
hzxuzhonghu opened this issue Nov 11, 2024 · 2 comments
Open
Labels
kind/enhancement New feature or request

Comments

@hzxuzhonghu
Copy link
Member

What would you like to be added:

In tcp probe, we construct sock tuple with https://github.com/kmesh-net/kmesh/blob/main/bpf/kmesh/probes/tcp_probe.h#L118

But in sokops, we use https://github.com/kmesh-net/kmesh/blob/main/bpf/kmesh/workload/sockops.c#L132

They are much similar except the port byte order, this lead to two different ways of parsing the tuple in usersapce go implemention.

Why is this needed:

To reduce developers burden on understanding the byte order.

@hzxuzhonghu hzxuzhonghu added the kind/enhancement New feature or request label Nov 11, 2024
@harisudarsan1
Copy link

@hzxuzhonghu Seems like in case of tcp_probe we are converting to host byte and in case of sockops we are converting to network byte order. So which order is preferred for unifying the port byte order?

@hzxuzhonghu
Copy link
Member Author

To be clear, i think we can always use host byte order when we need to pass the info to userspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants