From 78c18cfbdbe7971c8cbc822f839ccc15d47b3086 Mon Sep 17 00:00:00 2001 From: bitcoffee Date: Wed, 8 May 2024 11:11:59 +0800 Subject: [PATCH] Kmesh: repair kmesh manager not effect in sockops on oe 23.03 sockops port is not same as other linux vendor. We need to adapt oe 23.03. Signed-off-by: bitcoffee --- bpf/kmesh/workload/sockops_tuple.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bpf/kmesh/workload/sockops_tuple.c b/bpf/kmesh/workload/sockops_tuple.c index 98b64e55a..90b66d822 100644 --- a/bpf/kmesh/workload/sockops_tuple.c +++ b/bpf/kmesh/workload/sockops_tuple.c @@ -155,7 +155,7 @@ static inline bool conn_from_cni_sim_add(struct bpf_sock_ops *skops) #if !OE_23_03 return ((bpf_ntohl(skops->remote_ip4) == 1) && (bpf_ntohl(skops->remote_port) == 0x3a1)); #else - return ((bpf_ntohl(skops->remote_ip4) == 1) && (bpf_ntohl(skops->remote_port) == 0xa1030000)); + return ((bpf_ntohl(skops->remote_ip4) == 1) && (bpf_ntohl(skops->remote_port) == 0x3a10000)); #endif } @@ -163,7 +163,11 @@ static inline bool conn_from_cni_sim_delete(struct bpf_sock_ops *skops) { // cni sim connect 0.0.0.1:930(0x3a2) // 0x3a2 is the specific port handled by the cni for disable Kmesh +#if !OE_23_03 return ((bpf_ntohl(skops->remote_ip4) == 1) && (bpf_ntohl(skops->remote_port) == 0x3a2)); +#else + return ((bpf_ntohl(skops->remote_ip4) == 1) && (bpf_ntohl(skops->remote_port) == 0x3a20000)); +#endif } static inline bool ipv4_mapped_addr(__u32 ip6[4])