1
0
mirror of https://passt.top/passt synced 2024-10-02 03:55:48 +00:00

tcp_splice: Logically dead code, CWE-561

Reported by Coverity.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2022-04-05 12:43:09 +02:00
parent 71a00f1449
commit 264d68edcf

View File

@ -139,9 +139,6 @@ static void tcp_splice_conn_epoll_events(uint16_t events,
{ {
*a = *b = 0; *a = *b = 0;
if (events & CLOSED)
return;
if (events & ESTABLISHED) { if (events & ESTABLISHED) {
if (!(events & B_FIN_SENT)) if (!(events & B_FIN_SENT))
*a = EPOLLIN | EPOLLRDHUP; *a = EPOLLIN | EPOLLRDHUP;
@ -649,8 +646,8 @@ swap:
} }
while (1) { while (1) {
int retry_write = 0, more = 0;
ssize_t readlen, to_write = 0, written; ssize_t readlen, to_write = 0, written;
int more = 0;
retry: retry:
readlen = splice(from, NULL, pipes[1], NULL, c->tcp.pipe_size, readlen = splice(from, NULL, pipes[1], NULL, c->tcp.pipe_size,
@ -715,9 +712,6 @@ eintr:
if (never_read) if (never_read)
break; break;
if (retry_write--)
goto retry;
if (to == conn->a) if (to == conn->a)
conn_event(c, conn, A_OUT_WAIT); conn_event(c, conn, A_OUT_WAIT);
else else