From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 1F74D5A004E for ; Thu, 06 Jun 2024 04:03:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1717639386; bh=MtsAg4cWrCpX9dVcvRObi1ZJAPENimzLbURqOX1Jvx4=; h=From:To:Cc:Subject:Date:From; b=jVoq8wfceeXXJ2PQMf5MXWkCyPEjWGZWvuiOSu67ziJ7dcn1N+wMW7Wj7oLAe3dV5 56MIrht2YUqrjruiUDsOirNf6xCL7N6UAp6AOfKeOSvtHMieIPDuUAOG6F+zoZwsc6 pyVTvx0UYmYxrX+ta2vcISMCbk3/JcODXp6SohQzBUIHQlBZg8BxlxXBwNktVtWOCG PGtYZiAFkN++s64c/6+1tyseiU8Hh72zZJYYui3iMVyh9HME63hJFNiRWu2ff0FQfT Nrn6ryAoAAl5hLR15GqSC/ylrApvSHtNckqJTkiO0HHC/7LbTRps6cz5qVhommtJpv VOMS2rh+IUksw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Vvnff6Lywz4wcl; Thu, 6 Jun 2024 12:03:06 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v6] tcp: Make pointer const in tcp_revert_seq Date: Thu, 6 Jun 2024 12:03:05 +1000 Message-ID: <20240606020305.4125785-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: B7ERPUKWEUYXKXYFZUOWROTCDJASRKIP X-Message-ID-Hash: B7ERPUKWEUYXKXYFZUOWROTCDJASRKIP X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: jmaloy@redhat.com, David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The th pointer could be const, which causes a cppcheck warning on at least some cppcheck versions (e.g. Cppcheck 2.13.0 in Fedora 40). Fixes: e84a01e94 "tcp: move seq_to_tap update to when frame is queued" Signed-off-by: David Gibson --- tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp.c b/tcp.c index 89a5b19a..ff1198dd 100644 --- a/tcp.c +++ b/tcp.c @@ -1261,8 +1261,8 @@ static void tcp_revert_seq(struct tcp_tap_conn **conns, struct iovec (*frames)[T int i; for (i = 0; i < num_frames; i++) { + const struct tcphdr *th = frames[i][TCP_IOV_PAYLOAD].iov_base; struct tcp_tap_conn *conn = conns[i]; - struct tcphdr *th = frames[i][TCP_IOV_PAYLOAD].iov_base; uint32_t seq = ntohl(th->seq); if (SEQ_LE(conn->seq_to_tap, seq)) -- 2.45.2