Message ID | 20220830133905.9945-1-maciej.fijalkowski@intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8a7d61bdc2fac2c460a2f32a062f5c6dbd21a764 |
Delegated to: | BPF |
Headers | show |
Series | [bpf] selftests: xsk: add missing close() on netns fd | expand |
Hello: This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Tue, 30 Aug 2022 15:39:05 +0200 you wrote: > Commit 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") > removed close on netns fd, which is not correct, so let us restore it. > > Fixes: 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") > Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> > > [...] Here is the summary with links: - [bpf] selftests: xsk: add missing close() on netns fd https://git.kernel.org/bpf/bpf/c/8a7d61bdc2fa You are awesome, thank you!
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c index 333cf23c01b5..d64652558d12 100644 --- a/tools/testing/selftests/bpf/xskxceiver.c +++ b/tools/testing/selftests/bpf/xskxceiver.c @@ -1698,6 +1698,8 @@ static struct ifobject *ifobject_create(void) if (!ifobj->umem) goto out_umem; + ifobj->ns_fd = -1; + return ifobj; out_umem: @@ -1709,6 +1711,8 @@ static struct ifobject *ifobject_create(void) static void ifobject_delete(struct ifobject *ifobj) { + if (ifobj->ns_fd != -1) + close(ifobj->ns_fd); free(ifobj->umem); free(ifobj->xsk_arr); free(ifobj);