From 3ede07aac96eababe3b1c335058e851a9951d17d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Sat, 24 Sep 2022 19:08:21 +1000 Subject: Treat port numbers as unsigned Port numbers are unsigned values, but we're storing them in (signed) int variables in some places. This isn't actually harmful, because int is large enough to hold the entire range of ports. However in places we don't want to use an in_port_t (usually to avoid overflow on the last iteration of a loop) it makes more conceptual sense to use an unsigned int. This will also avoid some problems with later cleanups. Signed-off-by: David Gibson --- udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'udp.c') diff --git a/udp.c b/udp.c index d17b3b4..27c3aa3 100644 --- a/udp.c +++ b/udp.c @@ -1193,7 +1193,7 @@ void udp_sock_init(const struct ctx *c, int ns, sa_family_t af, int udp_sock_init_ns(void *arg) { struct ctx *c = (struct ctx *)arg; - int dst; + unsigned dst; if (ns_enter(c)) return 0; -- cgit v1.2.3