]> git.ipfire.org Git - thirdparty/iproute2.git/commit
lib: bpf_legacy: fix missing socket close when connect() fails
authorAndrea Claudi <aclaudi@redhat.com>
Mon, 19 Apr 2021 13:49:57 +0000 (15:49 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 27 Apr 2021 04:05:19 +0000 (21:05 -0700)
commite1ad689545a0a2a798869cb95de7dbe4b138bdae
treea05ed3d5926997c648b80236754940d3de8c9c64
parent92af24c9078e0c3f3d3c191d78db91fe10df6bc1
lib: bpf_legacy: fix missing socket close when connect() fails

In functions bpf_{send,recv}_map_fds(), when connect fails after a
socket is successfully opened, we return with error missing a close on
the socket.

Fix this closing the socket if opened and using a single return point
for both the functions.

Fixes: 6256f8c9e45f ("tc, bpf: finalize eBPF support for cls and act front-end")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/bpf_legacy.c