aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-07 12:40:15 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-07 09:53:41 +0100
commit732e24937618f5848e182dc8a38eb170cf079394 (patch)
treef9748dad8026c85506fad12fd8bb400782635be9 /tcp.c
parent125c5e52a5c963ead98b175c440314b4c9071143 (diff)
downloadpasst-732e24937618f5848e182dc8a38eb170cf079394.tar
passt-732e24937618f5848e182dc8a38eb170cf079394.tar.gz
passt-732e24937618f5848e182dc8a38eb170cf079394.tar.bz2
passt-732e24937618f5848e182dc8a38eb170cf079394.tar.lz
passt-732e24937618f5848e182dc8a38eb170cf079394.tar.xz
passt-732e24937618f5848e182dc8a38eb170cf079394.tar.zst
passt-732e24937618f5848e182dc8a38eb170cf079394.zip
pif: Record originating pif in listening socket refs
For certain socket types, we record in the epoll ref whether they're sockets in the namespace, or on the host. We now have the notion of "pif" to indicate what "place" a socket is associated with, so generalise the simple one-bit 'ns' to a pif id. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tcp.c b/tcp.c
index c13b7de..bad8c38 100644
--- a/tcp.c
+++ b/tcp.c
@@ -2964,6 +2964,7 @@ static int tcp_sock_init_af(const struct ctx *c, int af, in_port_t port,
{
union tcp_listen_epoll_ref tref = {
.port = port + c->tcp.fwd_in.delta[port],
+ .pif = PIF_HOST,
};
int s;
@@ -3025,7 +3026,7 @@ static void tcp_ns_sock_init4(const struct ctx *c, in_port_t port)
{
union tcp_listen_epoll_ref tref = {
.port = port + c->tcp.fwd_out.delta[port],
- .ns = true,
+ .pif = PIF_SPLICE,
};
struct in_addr loopback = { htonl(INADDR_LOOPBACK) };
int s;
@@ -3051,7 +3052,7 @@ static void tcp_ns_sock_init6(const struct ctx *c, in_port_t port)
{
union tcp_listen_epoll_ref tref = {
.port = port + c->tcp.fwd_out.delta[port],
- .ns = true,
+ .pif = PIF_SPLICE,
};
int s;