From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 7832B5A0268; Thu, 16 Feb 2023 19:54:38 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] conf: Fix typo in conf_ports() check for UDP port binding Date: Thu, 16 Feb 2023 19:54:38 +0100 Message-Id: <20230216185438.2327670-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: DNXTQHOL6BGX7B3H2AKOF5MWEV3LL6TH X-Message-ID-Hash: DNXTQHOL6BGX7B3H2AKOF5MWEV3LL6TH X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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; } } -- 2.35.1