aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-08-22 15:29:58 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-08-22 12:15:36 +0200
commitb60fa33eeafbe2d73d3a4cb6586dd4d637751fa7 (patch)
tree8be1d614dad751b9bb746944eee48ec9e5c3d8b6 /tcp_splice.c
parent955dd3251c9e9b0a1469015748e4600f68e8de0a (diff)
downloadpasst-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.tar
passt-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.tar.gz
passt-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.tar.bz2
passt-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.tar.lz
passt-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.tar.xz
passt-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.tar.zst
passt-b60fa33eeafbe2d73d3a4cb6586dd4d637751fa7.zip
tcp: Move in_epoll flag out of common connection structure
The in_epoll boolean is one of only two fields (currently) in the common structure shared between tap and spliced connections. It seems like it belongs there, because both tap and spliced connections use it, and it has roughly the same meaning. Roughly, however, isn't exactly: which fds this flag says are in the epoll varies between the two connection types, and are in type specific fields. So, it's only possible to meaningfully use this value locally in type specific code anyway. This common field is going to get in the way of more widespread generalisation of connection / flow tracking, so move it to separate fields in the tap and splice specific structures. 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 64c1263..1f89d6a 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -172,7 +172,7 @@ static void conn_flag_do(const struct ctx *c, struct tcp_splice_conn *conn,
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;
+ int m = conn->in_epoll ? EPOLL_CTL_MOD : EPOLL_CTL_ADD;
union epoll_ref ref_a = { .type = EPOLL_TYPE_TCP, .fd = conn->a,
.tcp.index = CONN_IDX(conn) };
union epoll_ref ref_b = { .type = EPOLL_TYPE_TCP, .fd = conn->b,
@@ -192,7 +192,7 @@ static int tcp_splice_epoll_ctl(const struct ctx *c,
epoll_ctl(c->epollfd, m, conn->b, &ev_b))
goto delete;
- conn->c.in_epoll = true;
+ conn->in_epoll = true;
return 0;