diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-17 16:58:50 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-11-25 01:35:02 +0100 |
commit | 73d3a3e84eeea5566a3a65b033cf1d933b07c2ee (patch) | |
tree | ab630a80da0ab7bdb72d9bbd72d81a28ee7872e5 /tcp.h | |
parent | 433604a581604fe8acfa9a9022b9c29305642ab7 (diff) | |
download | passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.tar passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.tar.gz passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.tar.bz2 passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.tar.lz passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.tar.xz passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.tar.zst passt-73d3a3e84eeea5566a3a65b033cf1d933b07c2ee.zip |
tcp: Separate helpers to create ns listening sockets
tcp_sock_init*() can create either sockets listening on the host, or in
the pasta network namespace (with @ns==1). There are, however, a number
of differences in how these two cases work in practice though. "ns"
sockets are only used in pasta mode, and they always lead to spliced
connections only. The functions are also only ever called in "ns" mode
with a NULL address and interface name, and it doesn't really make sense
for them to be called any other way.
Later changes will introduce further differences in behaviour between these
two cases, so it makes more sense to use separate functions for creating
the ns listening sockets than the regular external/host listening sockets.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.h')
-rw-r--r-- | tcp.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -19,8 +19,8 @@ void tcp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events, const struct timespec *now); int tcp_tap_handler(struct ctx *c, int af, const void *addr, const struct pool *p, const struct timespec *now); -void tcp_sock_init(const struct ctx *c, int ns, sa_family_t af, - const void *addr, const char *ifname, in_port_t port); +void tcp_sock_init(const struct ctx *c, sa_family_t af, const void *addr, + const char *ifname, in_port_t port); int tcp_init(struct ctx *c); void tcp_timer(struct ctx *c, const struct timespec *ts); void tcp_defer_handler(struct ctx *c); |