aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-01-15 17:39:43 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-01-16 21:49:27 +0100
commita179ca6707b29cfc01371fb5636b2f49d263ab83 (patch)
treea783d015ca015059be6ce1b54e91565ef221c498 /tcp.c
parentf60c85194b87c6cc182b9868c9e6a6b8ac1af48f (diff)
downloadpasst-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.gz
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.bz2
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.lz
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.xz
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.zst
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.zip
treewide: Make a bunch of pointer variables pointers to const
Sufficiently recent cppcheck (I'm using 2.13.0) seems to have added another warning for pointer variables which could be pointer to const but aren't. Use this to make a bunch of variables const pointers where they previously weren't for no particular reason. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tcp.c b/tcp.c
index 9515649..5b37662 100644
--- a/tcp.c
+++ b/tcp.c
@@ -2296,7 +2296,7 @@ static int tcp_data_from_tap(struct ctx *c, struct tcp_tap_conn *conn,
for (i = idx, iov_i = 0; i < (int)p->count; i++) {
uint32_t seq, seq_offset, ack_seq;
- struct tcphdr *th;
+ const struct tcphdr *th;
char *data;
size_t off;
@@ -2517,10 +2517,10 @@ int tcp_tap_handler(struct ctx *c, uint8_t pif, int af,
const struct pool *p, int idx, const struct timespec *now)
{
struct tcp_tap_conn *conn;
+ const struct tcphdr *th;
size_t optlen, len;
- struct tcphdr *th;
+ const char *opts;
int ack_due = 0;
- char *opts;
int count;
(void)pif;
@@ -3038,7 +3038,7 @@ void tcp_ns_sock_init(const struct ctx *c, in_port_t port)
*/
static int tcp_ns_socks_init(void *arg)
{
- struct ctx *c = (struct ctx *)arg;
+ const struct ctx *c = (const struct ctx *)arg;
unsigned port;
ns_enter(c);