* [PATCH] conf: Fix typo in conf_ports() check for UDP port binding
@ 2023-02-16 18:54 Stefano Brivio
0 siblings, 0 replies; only message in thread
From: Stefano Brivio @ 2023-02-16 18:54 UTC (permalink / raw)
To: passt-dev
Ouch, I accidentally pushed the previous change without running the
tests: we need to check, in conf_ports(), that udp_sock_init()
managed to bind at least a port, not the opposite.
Fixes: 3d0de2c1d727 ("conf, tcp, udp: Exit if we fail to bind sockets for all given ports")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/conf.c b/conf.c
index 5426c9b..60ca399 100644
--- a/conf.c
+++ b/conf.c
@@ -356,7 +356,7 @@ static void conf_ports(const struct ctx *c, char optname, const char *optarg,
if (!tcp_sock_init(c, af, addr, ifname, i))
bound_one = true;
} else if (optname == 'u') {
- if (udp_sock_init(c, 0, af, addr, ifname, i))
+ if (!udp_sock_init(c, 0, af, addr, ifname, i))
bound_one = true;
}
}
--
@@ -356,7 +356,7 @@ static void conf_ports(const struct ctx *c, char optname, const char *optarg,
if (!tcp_sock_init(c, af, addr, ifname, i))
bound_one = true;
} else if (optname == 'u') {
- if (udp_sock_init(c, 0, af, addr, ifname, i))
+ if (!udp_sock_init(c, 0, af, addr, ifname, i))
bound_one = true;
}
}
--
2.35.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-16 18:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 18:54 [PATCH] conf: Fix typo in conf_ports() check for UDP port binding Stefano Brivio
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).