aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-04-05 12:43:09 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-04-07 11:44:35 +0200
commit264d68edcf797709837c6919f58a2170c4effddf (patch)
treea27f0e4d36de386c50b14fb4e4de1d92b3d65935 /tcp_splice.c
parent71a00f14493b261f41516beb72380372cc1e14d7 (diff)
downloadpasst-264d68edcf797709837c6919f58a2170c4effddf.tar
passt-264d68edcf797709837c6919f58a2170c4effddf.tar.gz
passt-264d68edcf797709837c6919f58a2170c4effddf.tar.bz2
passt-264d68edcf797709837c6919f58a2170c4effddf.tar.lz
passt-264d68edcf797709837c6919f58a2170c4effddf.tar.xz
passt-264d68edcf797709837c6919f58a2170c4effddf.tar.zst
passt-264d68edcf797709837c6919f58a2170c4effddf.zip
tcp_splice: Logically dead code, CWE-561
Reported by Coverity. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r--tcp_splice.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index 84df8ed..7c19d99 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -139,9 +139,6 @@ static void tcp_splice_conn_epoll_events(uint16_t events,
{
*a = *b = 0;
- if (events & CLOSED)
- return;
-
if (events & ESTABLISHED) {
if (!(events & B_FIN_SENT))
*a = EPOLLIN | EPOLLRDHUP;
@@ -649,8 +646,8 @@ swap:
}
while (1) {
- int retry_write = 0, more = 0;
ssize_t readlen, to_write = 0, written;
+ int more = 0;
retry:
readlen = splice(from, NULL, pipes[1], NULL, c->tcp.pipe_size,
@@ -715,9 +712,6 @@ eintr:
if (never_read)
break;
- if (retry_write--)
- goto retry;
-
if (to == conn->a)
conn_event(c, conn, A_OUT_WAIT);
else