aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-08-11 15:12:21 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-08-13 17:29:51 +0200
commit34016444534120f2fa5a049675815843d041bc16 (patch)
tree2b61ca5998e756c0b8b8b316171941619bc01dcb /tcp_splice.c
parente26282b67d013f775eacd8603fa5ec1397dec714 (diff)
downloadpasst-34016444534120f2fa5a049675815843d041bc16.tar
passt-34016444534120f2fa5a049675815843d041bc16.tar.gz
passt-34016444534120f2fa5a049675815843d041bc16.tar.bz2
passt-34016444534120f2fa5a049675815843d041bc16.tar.lz
passt-34016444534120f2fa5a049675815843d041bc16.tar.xz
passt-34016444534120f2fa5a049675815843d041bc16.tar.zst
passt-34016444534120f2fa5a049675815843d041bc16.zip
epoll: Generalize epoll_ref to cover things other than sockets
The epoll_ref type includes fields for the IP protocol of a socket, and the socket fd. However, we already have a few things in the epoll which aren't protocol sockets, and we may have more in future. Rename these fields to an abstract "fd type" and file descriptor for more generality. Similarly, rather than using existing IP protocol numbers for the type, introduce our own number space. For now these just correspond to the supported protocols, but we'll expand on that in future. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r--tcp_splice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index 03e14c1..24995e2 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -173,9 +173,9 @@ static int tcp_splice_epoll_ctl(const struct ctx *c,
struct tcp_splice_conn *conn)
{
int m = conn->c.in_epoll ? EPOLL_CTL_MOD : EPOLL_CTL_ADD;
- union epoll_ref ref_a = { .proto = IPPROTO_TCP, .s = conn->a,
+ union epoll_ref ref_a = { .type = EPOLL_TYPE_TCP, .fd = conn->a,
.tcp.index = CONN_IDX(conn) };
- union epoll_ref ref_b = { .proto = IPPROTO_TCP, .s = conn->b,
+ union epoll_ref ref_b = { .type = EPOLL_TYPE_TCP, .fd = conn->b,
.tcp.index = CONN_IDX(conn) };
struct epoll_event ev_a = { .data.u64 = ref_a.u64 };
struct epoll_event ev_b = { .data.u64 = ref_b.u64 };