aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-12-11 14:54:34 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-12-12 22:19:46 +0100
commitd6c5b6ee1ddeafdede00a5745ee0d72fea565356 (patch)
tree6508a9fbeb031250bd424f8dd2dd54732fe3ea24
parentd04c48032bcf724550d0b8f652fd00efcd2dfad0 (diff)
downloadpasst-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.tar
passt-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.tar.gz
passt-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.tar.bz2
passt-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.tar.lz
passt-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.tar.xz
passt-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.tar.zst
passt-d6c5b6ee1ddeafdede00a5745ee0d72fea565356.zip
tcp: Suppress new instance of cppcheck bug 14191
ee9b2361d ("cppcheck: Suppress a buggy cppcheck warning") added a a suppression for a cppchec bug, since filed (and fixed) in upstream cppcheck as https://trac.cppcheck.net/ticket/14191. 9139e60fd ("tcp: Acknowledge everything if it looks like bulk traffic, not interactive") introduced a new point which triggers the same cppcheck bug. Add a suppression for the new instance. This is a revision of Laurent's earlier patch, updating the comments to make the connection between the two instances clear, and adding unmatchedSuppression so it doesn't cause a bogus warning with unaffected cppcheck versions. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tcp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tcp.c b/tcp.c
index 7c721b4..1711bcc 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1132,6 +1132,11 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn,
return 0;
}
+ /* This trips a cppcheck bug in some versions, including
+ * cppcheck 2.18.3.
+ * https://trac.cppcheck.net/ticket/14191
+ */
+ /* cppcheck-suppress [uninitvar,unmatchedSuppression] */
if ((unsigned)SNDBUF_GET(conn) > (long long)tinfo->tcpi_rtt *
tinfo->tcpi_delivery_rate /
1000 / 1000 *
@@ -1143,10 +1148,7 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn,
/* Fall back to acknowledging everything we got */
conn->seq_ack_to_tap = conn->seq_from_tap;
} else {
- /* This trips a cppcheck bug in some versions, including
- * cppcheck 2.18.3.
- * https://sourceforge.net/p/cppcheck/discussion/general/thread/fecde59085/
- */
+ /* cppcheck bug 14191 again, see above */
/* cppcheck-suppress [uninitvar,unmatchedSuppression] */
conn->seq_ack_to_tap = tinfo->tcpi_bytes_acked +
conn->seq_init_from_tap;