aboutgitcodebugslistschat
path: root/udp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-09-24 19:08:21 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-09-24 14:48:35 +0200
commit3ede07aac96eababe3b1c335058e851a9951d17d (patch)
tree284773ba582b574635a6186b16646ed7e78b1764 /udp.c
parent0d1886dca01df2d12697422c09a8d8f76dff0400 (diff)
downloadpasst-3ede07aac96eababe3b1c335058e851a9951d17d.tar
passt-3ede07aac96eababe3b1c335058e851a9951d17d.tar.gz
passt-3ede07aac96eababe3b1c335058e851a9951d17d.tar.bz2
passt-3ede07aac96eababe3b1c335058e851a9951d17d.tar.lz
passt-3ede07aac96eababe3b1c335058e851a9951d17d.tar.xz
passt-3ede07aac96eababe3b1c335058e851a9951d17d.tar.zst
passt-3ede07aac96eababe3b1c335058e851a9951d17d.zip
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 <david@gibson.dropbear.id.au>
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c2
1 files changed, 1 insertions, 1 deletions
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;