Message ID | 1f670acc8c3b1606609b017a4953f4ddab3b1794.1732181420.git.tanggeliang@kylinos.cn (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Squash to "Add mptcp_subflow bpf_iter support" | expand |
Context | Check | Description |
---|---|---|
matttbe/build | success | Build and static analysis OK |
matttbe/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 22 lines checked |
matttbe/shellcheck | success | MPTCP selftests files have not been modified |
matttbe/KVM_Validation__normal | success | Success! ✅ |
matttbe/KVM_Validation__debug | success | Success! ✅ |
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ | success | Success! ✅ |
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ | success | Success! ✅ |
diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c index 1bede22a7e3d..5e475edf37b3 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c @@ -21,12 +21,11 @@ int iters_subflow(struct bpf_sockopt *ctx) struct mptcp_sock *msk; int local_ids = 0; - if (!sk || sk->protocol != IPPROTO_MPTCP || - ctx->level != SOL_TCP || ctx->optname != TCP_IS_MPTCP) + if (ctx->level != SOL_TCP || ctx->optname != TCP_IS_MPTCP) return 1; msk = bpf_mptcp_sk((struct sock *)sk); - if (msk->pm.server_side || !msk->pm.subflows) + if (!msk || msk->pm.server_side || !msk->pm.subflows) return 1; msk = bpf_mptcp_sock_acquire(msk); @@ -53,7 +52,7 @@ int iters_subflow(struct bpf_sockopt *ctx) /* only to check the following kfunc works */ subflow = bpf_mptcp_subflow_ctx(ssk); - if (subflow->token != msk->token) + if (!subflow || subflow->token != msk->token) goto out; ids = local_ids;