From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 76B3B5A031B for ; Wed, 14 Aug 2024 06:30:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1723609853; bh=MtZ6i/0s7aEHfRS5aDUpF4qmD0fU2POxFA51iu2C+is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F0rGqO595jwJ9djd0iphqad57a20uhDSqkKlJddZQ59qG7n0NEoXHNvJBM0ZnWGoS vixeOKm7O0/Xp7g+naJJOikwkGg2a6ZTVqn8taJOnoOwY4Ls4vgNeFEsPOf9T9Yz2K SMKQ9gRPFSHm+sgFG43Zl+FzprdIAyfZg5MhjrTIqpE1ybXIbnRn30VkWG5foFdskn rC0Ro8QWMR80SI48l3Loe0F2QZ8ghVt6bGSgO7lV+vcM4jURTV5I9zDXkDze87+Cp4 wVzauH1GkY1iA+rVqFbHVAz8akZtduNHmhRHvqVeaPZjMpIi94PY/YWjwQzDb+AkhV 55rd814qI8D8g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WkFgK1VfXz4wnx; Wed, 14 Aug 2024 14:30:53 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 01/16] conf: Don't ignore -t and -u options after -D Date: Wed, 14 Aug 2024 14:30:35 +1000 Message-ID: <20240814043050.4177037-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814043050.4177037-1-david@gibson.dropbear.id.au> References: <20240814043050.4177037-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 5BN3HH4CQIMTP2RFBSD4KIRWM3I2ONHU X-Message-ID-Hash: 5BN3HH4CQIMTP2RFBSD4KIRWM3I2ONHU X-MailFrom: dgibson@gandalf.ozlabs.org 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 CC: David Gibson X-Mailman-Version: 3.3.8 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: f6d5a5239264 moved handling of -D into a later loop. However as a side effect it moved this from a switch block to an if block. I left a couple of 'break' statements that don't make sense in the new context. They should be 'continue' so that we go onto the next option, rather than leaving the loop entirely. Fixes: f6d5a5239264 ("conf: Delay handling -D option until after...") Signed-off-by: David Gibson --- conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.c b/conf.c index 76d37da0..ed097bdc 100644 --- a/conf.c +++ b/conf.c @@ -1682,13 +1682,13 @@ void conf(struct ctx *c, int argc, char **argv) if (dns4 - &c->ip4.dns[0] < ARRAY_SIZE(c->ip4.dns) && inet_pton(AF_INET, optarg, &dns4_tmp)) { add_dns4(c, &dns4_tmp, &dns4); - break; + continue; } if (dns6 - &c->ip6.dns[0] < ARRAY_SIZE(c->ip6.dns) && inet_pton(AF_INET6, optarg, &dns6_tmp)) { add_dns6(c, &dns6_tmp, &dns6); - break; + continue; } die("Cannot use DNS address %s", optarg); -- 2.46.0