From 732e24937618f5848e182dc8a38eb170cf079394 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 7 Nov 2023 12:40:15 +1100 Subject: 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 Signed-off-by: Stefano Brivio --- tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tcp.c') 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; -- cgit v1.2.3