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 83E495A004F for ; Thu, 06 Jun 2024 12:10:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1717668601; bh=MtsAg4cWrCpX9dVcvRObi1ZJAPENimzLbURqOX1Jvx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gzSTFt/TZj9m0SQDfeMHRkeZCP4SV16YYfVDQjJXHXmgMbZTaN+Xzb/JzZ0htHaWO 1Hu9IO9tjV/i5vBvSaMO2eDeVzRjwyJd3WsLCypFXJ0CRSXMfC/uA1F0u87oXeF/Pp FvhsMq9OrRJdEMDh3q4Vb4Wt7RNMogVKqSdaZkxabe/GQLVDf4KMQpSP68p8TwRBJ8 /uEjftfRVSsVwS5hy7vcfUXBI3fua7/HDwXKGeOAnA5AIDjHk8U9OY0GNk+xhCZlNm 0DtojBoRAhAlfPhCW9W2ntJDKGNim6orCj2dwxqLsRtD+up7vYjvNFYjQ02UuCwMme E4yNTPKgVj6GQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Vw0ST37V0z4wbp; Thu, 6 Jun 2024 20:10:01 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 1/9] tcp: Make pointer const in tcp_revert_seq Date: Thu, 6 Jun 2024 20:09:41 +1000 Message-ID: <20240606100949.1250958-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606100949.1250958-1-david@gibson.dropbear.id.au> References: <20240606100949.1250958-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: CABYBQNQBLVJHXYDYE43VEUJNVBVCIBN X-Message-ID-Hash: CABYBQNQBLVJHXYDYE43VEUJNVBVCIBN 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: 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