From 5445c189158609cf95bb5395f1f6deb857ec6e33 Mon Sep 17 00:00:00 2001 From: weli-l <1289113577@qq.com> Date: Sat, 21 Sep 2024 12:20:11 +0800 Subject: [PATCH] fix enable service failure after delete bpf progs in mda Signed-off-by: weli-l <1289113577@qq.com> --- ...ce-failure-after-delete-bpf-progs-in.patch | 25 +++++++++++++++++++ Kmesh.spec | 8 ++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 Fix-enable-service-failure-after-delete-bpf-progs-in.patch diff --git a/Fix-enable-service-failure-after-delete-bpf-progs-in.patch b/Fix-enable-service-failure-after-delete-bpf-progs-in.patch new file mode 100644 index 0000000..8e0c36c --- /dev/null +++ b/Fix-enable-service-failure-after-delete-bpf-progs-in.patch @@ -0,0 +1,25 @@ +From da14458baae460f8a66d800af18606c1cc717e27 Mon Sep 17 00:00:00 2001 +From: weli-l <1289113577@qq.com> +Date: Sat, 21 Sep 2024 12:12:53 +0800 +Subject: [PATCH] Fix enable service failure after delete bpf progs in mda + +--- + oncn-mda/cli_src/func/switch.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/oncn-mda/cli_src/func/switch.c b/oncn-mda/cli_src/func/switch.c +index a2d33694..478a1459 100644 +--- a/oncn-mda/cli_src/func/switch.c ++++ b/oncn-mda/cli_src/func/switch.c +@@ -216,8 +216,6 @@ static int attach_program(const struct mesh_service_info *const fds) + unsigned int flags; + for (int i = (int)MESH_PROG_NUM - 1; i >= 0; --i) { + flags = 0; +- if (strcmp(fds->prog_fds[i].name, to_str(SOCK_OPS_NAME)) == 0) +- flags = BPF_F_ALLOW_MULTI; + if (bpf_prog_attach(fds->prog_fds[i].fd, fds->prog_fds[i].attach_fd, fds->prog_fds[i].attach_type, flags)) { + macli_log(ERR, "failed to attach %s, errno:%d\n", fds->prog_fds[i].pin_file_path, errno); + return FAILED; +-- +2.43.0 + diff --git a/Kmesh.spec b/Kmesh.spec index 2e4123a..169606a 100644 --- a/Kmesh.spec +++ b/Kmesh.spec @@ -1,7 +1,7 @@ %global codepath kmesh Name: Kmesh Version: 0.4.0 -Release: 1 +Release: 2 Summary: %{name} is a eBPF-based service mesh kernel solution License: ASL 2.0 and GPL-2.0 URL: https://github.com/kmesh-net @@ -23,6 +23,7 @@ Patch0001: Downgrade-go-version-to-v1.21.4.patch Patch0002: Remove-useless-tag-in-Makefile.patch Patch0003: Fix-pod-management-cannot-be-canceled.patch Patch0004: Support-uid-gid.patch +Patch0005: Fix-enable-service-failure-after-delete-bpf-progs-in.patch %description %{name} is a eBPF-based service mesh kernel solution. @@ -122,7 +123,10 @@ rm -rf %{buildroot} %attr(0500,root,root) /kmesh/start_kmesh.sh %changelog -* Mon Jul 29 2024 weli-l<1289113577@qq.com> - 0.4.0-1 +* Sat Sep 21 2024 weli-l <1289113577@qq.com> - 0.4.0-2 +- fix enable service failure after delete bpf progs in mda + +* Mon Jul 29 2024 weli-l <1289113577@qq.com> - 0.4.0-1 - init Kmesh 0.4.0 * Fri Aug 18 2023 JofDiamonds - 0.3.0-3 -- Gitee