diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-01-15 17:39:43 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-01-16 21:49:27 +0100 |
commit | a179ca6707b29cfc01371fb5636b2f49d263ab83 (patch) | |
tree | a783d015ca015059be6ce1b54e91565ef221c498 /udp.c | |
parent | f60c85194b87c6cc182b9868c9e6a6b8ac1af48f (diff) | |
download | passt-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 'udp.c')
-rw-r--r-- | udp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -821,10 +821,10 @@ int udp_tap_handler(struct ctx *c, uint8_t pif, struct iovec m[UIO_MAXIOV]; struct sockaddr_in6 s_in6; struct sockaddr_in s_in; + const struct udphdr *uh; struct sockaddr *sa; int i, s, count = 0; in_port_t src, dst; - struct udphdr *uh; socklen_t sl; (void)c; @@ -1045,7 +1045,7 @@ int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, * udp_sock_init_init() - Bind sockets in init namespace for inbound connections * @c: Execution context */ -static void udp_sock_init_init(struct ctx *c) +static void udp_sock_init_init(const struct ctx *c) { unsigned dst; @@ -1065,7 +1065,7 @@ static void udp_sock_init_init(struct ctx *c) */ int udp_sock_init_ns(void *arg) { - struct ctx *c = (struct ctx *)arg; + const struct ctx *c = (const struct ctx *)arg; unsigned dst; ns_enter(c); |