diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-02-28 22:25:08 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-02-29 09:47:48 +0100 |
commit | 80f9b61b509c4a81e0f0f258b27d8eed1d24fa91 (patch) | |
tree | a0afde12e2bdc604a934af8dc22cd0edb3c2fb41 /port_fwd.c | |
parent | 76c7e1dca3c933bded7984e19322fa75d2ad3c28 (diff) | |
download | passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.tar passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.tar.gz passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.tar.bz2 passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.tar.lz passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.tar.xz passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.tar.zst passt-80f9b61b509c4a81e0f0f258b27d8eed1d24fa91.zip |
tcp_splice: Simplify clean up logic
Currently tcp_splice_flow_defer() contains specific logic to determine
if we're far enough initialised that we need to close pipes and/or
sockets. This is potentially fragile if we change something about the
order in which we do things. We can simplify this by initialising the
pipe and socket fields to -1 very early, then close()ing them if and
only if they're non-negative.
This lets us remove a special case cleanup if our connect() fails.
This will already trigger a CLOSING event, and the socket fd in
question is populated in the connection structure. Thus we can let
the new cleanup logic handle it rather than requiring an explicit
close().
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'port_fwd.c')
0 files changed, 0 insertions, 0 deletions