diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-17 16:58:52 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-11-25 01:35:22 +0100 |
commit | d909fda1e81979da12ed4ab8b2f2a18fba756a07 (patch) | |
tree | 10598d5ebd35e5a454e860ecd66b838c1f7c563c /inany.h | |
parent | 356c6e0677072f1a6cfe9b5d0648d89ab6fd5523 (diff) | |
download | passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.tar passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.tar.gz passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.tar.bz2 passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.tar.lz passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.tar.xz passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.tar.zst passt-d909fda1e81979da12ed4ab8b2f2a18fba756a07.zip |
tcp: Use the same sockets to listen for spliced and non-spliced connections
In pasta mode, tcp_sock_init[46]() create separate sockets to listen for
spliced connections (these are bound to localhost) and non-spliced
connections (these are bound to the host address). This introduces a
subtle behavioural difference between pasta and passt: by default, pasta
will listen only on a single host address, whereas passt will listen on
all addresses (0.0.0.0 or ::). This also prevents us using some additional
optimizations that only work with the unspecified (0.0.0.0 or ::) address.
However, it turns out we don't need to do this. We can splice a connection
if and only if it originates from the loopback address. Currently we
ensure this by having the "spliced" listening sockets listening only on
loopback. Instead, defer the decision about whether to splice a connection
until after accept(), by checking if the connection was made from the
loopback address.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'inany.h')
0 files changed, 0 insertions, 0 deletions