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>
This commit is contained in:
David Gibson
2023-11-07 12:40:15 +11:00
committed by Stefano Brivio
parent 125c5e52a5
commit 732e249376
6 changed files with 28 additions and 23 deletions

4
tcp.h
View File

@@ -41,13 +41,13 @@ union tcp_epoll_ref {
/**
* union tcp_listen_epoll_ref - epoll reference portion for TCP listening
* @port: Port number we're forwarding *to* (listening port plus delta)
* @ns: True if listening within the pasta namespace
* @pif: pif in which the socket is listening
* @u32: Opaque u32 value of reference
*/
union tcp_listen_epoll_ref {
struct {
in_port_t port;
bool ns;
uint8_t pif;
};
uint32_t u32;
};