Message ID | 20220616180609.905015-7-maciej.fijalkowski@intel.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | AF_XDP ZC selftests | expand |
Maciej Fijalkowski wrote: > Commit 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") > removed close on netns fd, which is not correct, so let us restore it. > > Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Needs a Fixes tag and likely send it to bpf tree unless there is some reason not to.
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c index a1e410f6a5d8..81ad69ed5839 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -1591,6 +1591,8 @@ static struct ifobject *ifobject_create(void) if (!ifobj->umem) goto out_umem; + ifobj->ns_fd = -1; + return ifobj; out_umem: @@ -1602,6 +1604,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);