From 37b4f2ef03de033b3aa1d52d3248a3b52b4425d6 Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Tue, 11 Aug 2026 01:14:47 +0300 Subject: [PATCH] Use BPF_LINK_CREATE for attaching BPF programs Adopt the BPF_LINK_CREATE syscall for attaching programs, replacing the legacy attachment method. Fixes #13 --- tests/helpers.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/helpers.sh b/tests/helpers.sh index 9b506e3..98cecda 100755 --- a/tests/helpers.sh +++ b/tests/helpers.sh @@ -140,23 +140,23 @@ assert_cgroup_not_exists() { return 0 } -# Check that BPF programs are attached via bpftool +# Check that BPF links are attached via bpftool assert_bpf_attached() { local output - output=$(bpftool prog show 2>/dev/null || true) + output=$(bpftool link show 2>/dev/null || true) if echo "$output" | grep -q "egress_rl\|ingress_rl"; then return 0 fi - test_fail "no BPF programs (egress_rl/ingress_rl) found" + test_fail "no BPF links (egress_rl/ingress_rl) found" return 1 } -# Check that BPF programs are NOT attached (after unset/clean) +# Check that BPF links are NOT attached (after unset/clean) assert_bpf_not_attached() { local output - output=$(bpftool prog show 2>/dev/null || true) + output=$(bpftool link show 2>/dev/null || true) if echo "$output" | grep -q "egress_rl\|ingress_rl"; then - test_fail "BPF programs still present after cleanup" + test_fail "BPF links still present after cleanup" return 1 fi return 0