aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-07 13:42:40 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-07 09:53:46 +0100
commitd33cbc600e4d95356e1e80937dad0d3ef21e959e (patch)
treedf7eb830b092b1e68eaaf26963a2dedf2dfdbcc5 /tcp_splice.c
parentf6d8dc235553761a2541f7a6b782488160db03a7 (diff)
downloadpasst-d33cbc600e4d95356e1e80937dad0d3ef21e959e.tar
passt-d33cbc600e4d95356e1e80937dad0d3ef21e959e.tar.gz
passt-d33cbc600e4d95356e1e80937dad0d3ef21e959e.tar.bz2
passt-d33cbc600e4d95356e1e80937dad0d3ef21e959e.tar.lz
passt-d33cbc600e4d95356e1e80937dad0d3ef21e959e.tar.xz
passt-d33cbc600e4d95356e1e80937dad0d3ef21e959e.tar.zst
passt-d33cbc600e4d95356e1e80937dad0d3ef21e959e.zip
tcp_splice: Remove redundant tcp_splice_epoll_ctl()
tcp_splice_conn_update() calls tcp_splice_epoll_ctl() twice: first ignoring the return value, then checking it. This serves no purpose. If the first call succeeds, the second call will do exactly the same thing again, since nothing has changed in conn. If the first call fails, then tcp_splice_epoll_ctl() itself will EPOLL_CTL_DEL both fds, meaning when the second call tries to EPOLL_CTL_MOD them it will necessarily fail. It appears that this duplication was introduced by accident in an otherwise unrelated patch. Fixes: bb708111 ("treewide: Packet abstraction with mandatory boundary checks") 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.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index 133e825..87fbd50 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -255,7 +255,6 @@ static void conn_event_do(const struct ctx *c, struct tcp_splice_conn *conn,
*/
void tcp_splice_conn_update(const struct ctx *c, struct tcp_splice_conn *new)
{
- tcp_splice_epoll_ctl(c, new);
if (tcp_splice_epoll_ctl(c, new))
conn_flag(c, new, CLOSING);
}