From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH 1/2] tcp: Drop always-true !partial_send condition in tcp_data_from_tap()
Date: Thu, 15 Oct 2026 12:07:40 +0200 [thread overview]
Message-ID: <20261015100741.1583455-2-lvivier@redhat.com> (raw)
In-Reply-To: <20261015100741.1583455-1-lvivier@redhat.com>
When partial_send is true, the code returns early at the "keep != -1 ||
partial_send" check before reaching the fin handling block. Therefore
the !partial_send guard on the fin handling is always true when reached
and can be removed.
Detected with cppcheck 2.22.0
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcp.c b/tcp.c
index e279f8a121a5..95f4f3e12cf0 100644
--- a/tcp.c
+++ b/tcp.c
@@ -2160,7 +2160,7 @@ out:
conn->seq_ack_from_tap == conn->seq_to_tap)
conn_event(c, conn, TAP_FIN_ACKED, now);
- if (fin && !partial_send) {
+ if (fin) {
conn->seq_from_tap++;
conn_event(c, conn, TAP_FIN_RCVD, now);
--
2.56.0
next prev parent reply other threads:[~2026-10-15 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 10:07 [PATCH 0/2] cppcheck 2.22.0 fixes Laurent Vivier
2026-10-15 10:07 ` Laurent Vivier [this message]
2026-10-15 10:07 ` [PATCH 2/2] passt-repair: Suppress false positive cppcheck negativeIndex warning Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261015100741.1583455-2-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).