Commit 86149b4f authored by Michal Luczaj's avatar Michal Luczaj Committed by Martin KaFai Lau
Browse files

selftests/bpf: Introduce __attribute__((cleanup)) in create_pair()



Rewrite function to have (unneeded) socket descriptors automatically
close()d when leaving the scope. Make sure the "ownership" of fds is
correctly passed via take_fd(); i.e. descriptor returned to caller will
remain valid.

Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
Tested-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
Suggested-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: default avatarMichal Luczaj <mhal@rbox.co>
Link: https://lore.kernel.org/r/20240731-selftest-sockmap-fixes-v2-6-08a0c73abed2@rbox.co


Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parent c9c70b28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment