aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-06-06 20:09:41 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-06-07 20:44:44 +0200
commitd2afb4b6254ceb3d5a86c24eede93d186b927a29 (patch)
tree695de097a4e887202e33de1c9eff72990bbe96f7
parentb3aeb004eae0d168815d8ced8b3888e83e644cde (diff)
downloadpasst-d2afb4b6254ceb3d5a86c24eede93d186b927a29.tar
passt-d2afb4b6254ceb3d5a86c24eede93d186b927a29.tar.gz
passt-d2afb4b6254ceb3d5a86c24eede93d186b927a29.tar.bz2
passt-d2afb4b6254ceb3d5a86c24eede93d186b927a29.tar.lz
passt-d2afb4b6254ceb3d5a86c24eede93d186b927a29.tar.xz
passt-d2afb4b6254ceb3d5a86c24eede93d186b927a29.tar.zst
passt-d2afb4b6254ceb3d5a86c24eede93d186b927a29.zip
tcp: Make pointer const in tcp_revert_seq
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: e84a01e94c9f ("tcp: move seq_to_tap update to when frame is queued") Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp.c b/tcp.c
index 89a5b19..ff1198d 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))