Closed nlgwcy closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Flag | Coverage Δ | |
---|---|---|
unittests | 31.15% <ø> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
/reopen
@nlgwcy: Reopened this PR.
/lgtm /approve
[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
What type of PR is this?
/kind enhancement
What this PR does / why we need it: Current Situation:
bpf_sock_addr:user_port is stored in u16 network order. bpf_sock_ops:local_port is stored in u32 host order. bpf_sock_ops:remote_port oe23.03 is stored in u16 network order, while non-oe23.03 is stored in u32 network order. Currently, the port conversion is scattered throughout the code and not handled consistently.
Proposed Solution:
Treat all ports as u16. Maintain the byte order as defined originally. Provide dedicated macros to retrieve the remote_port and local_port of skops.
Which issue(s) this PR fixes: Fixes https://github.com/kmesh-net/kmesh/issues/374
Special notes for your reviewer:
self test:
[root@localhost images]# kubectl exec -ti fortio-client-deployment-6c86f967bf-p89pm -- fortio load -c 1 -t 30s http://10.96.52.254:80
dnat to fortio-server pod
[root@localhost ~]# nsenter -t 1321071 -n ss -antp State Recv-Q Send-Q Local Address:Port Peer Address:Port Process ESTAB 0 0 10.244.1.9:39254 10.244.1.8:9090 users:(("fortio",pid=1321071,fd=3))
[root@localhost kmesh]# kubectl apply -f - <<EOF