From a179ca6707b29cfc01371fb5636b2f49d263ab83 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 15 Jan 2024 17:39:43 +1100 Subject: 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 Signed-off-by: Stefano Brivio --- tap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tap.c') diff --git a/tap.c b/tap.c index 2ceda8d..396dee7 100644 --- a/tap.c +++ b/tap.c @@ -600,10 +600,10 @@ static int tap4_handler(struct ctx *c, const struct pool *in, resume: for (seq_count = 0, seq = NULL; i < in->count; i++) { size_t l2_len, l3_len, hlen, l4_len; - struct ethhdr *eh; + const struct ethhdr *eh; + const struct udphdr *uh; struct iphdr *iph; - struct udphdr *uh; - char *l4h; + const char *l4h; packet_get(in, i, 0, 0, &l2_len); @@ -765,9 +765,9 @@ resume: for (seq_count = 0, seq = NULL; i < in->count; i++) { size_t l4_len, plen, check; struct in6_addr *saddr, *daddr; + const struct ethhdr *eh; + const struct udphdr *uh; struct ipv6hdr *ip6h; - struct ethhdr *eh; - struct udphdr *uh; uint8_t proto; char *l4h; @@ -936,7 +936,7 @@ static void tap_sock_reset(struct ctx *c) void tap_handler_passt(struct ctx *c, uint32_t events, const struct timespec *now) { - struct ethhdr *eh; + const struct ethhdr *eh; ssize_t n, rem; char *p; -- cgit v1.2.3