From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=NnaS9Eog; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 49CB45A0652 for ; Fri, 27 Mar 2026 05:34:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1774586072; bh=YRGwJEMXR6RyqdV8lZdJwygfa6FNE59zwH9+VnSRUEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NnaS9Eog2pEq5Nbo/I6bTAIjg20ANcWqFEkxxI4uYSkQTlVQeCsn8cD3Rb1gh8l/U f9BFRFpXn9Jq4wjNmHseBjXJULJjQ5YhCxU+dG5RQazmUWqIZPncyLifaVuFAET6mp UAKTlOUDraAA+Dlscin1qjW5gdXtJvuW+OGPC75Nvef7Ue05SbtE6aYN4wwJP0MwH9 mEr/KchCuKrMfuVuxd1fvLtk4f/gYbJZCqYnu2jDRxFyz1/PgnCfK0Y39sbwECKw7W JxyD2jQqNBbCI735gpYaW0foTMS1D6u/WgXisKZ5JVGf4KQ3P83QLLaB0PtY9mixp2 yLwQPwjxu7hPw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4fhnqD5k9nz4wT7; Fri, 27 Mar 2026 15:34:32 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 11/18] conf: Don't bother complaining about overlapping excluded ranges Date: Fri, 27 Mar 2026 15:34:23 +1100 Message-ID: <20260327043430.1785787-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327043430.1785787-1-david@gibson.dropbear.id.au> References: <20260327043430.1785787-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: IC6CQFZVYEEU645WV5ER77SAOO7DVDCV X-Message-ID-Hash: IC6CQFZVYEEU645WV5ER77SAOO7DVDCV 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: In conf_ports() we die with an error if a port specification includes overlapping excluded ranges. This is contrary to our usual convention of handling conflicting options (last option wins, rather than error). Plus, these options don't even conflict, they're just redundant. This behaviour potentially makes life harder for scripts or other tools invoking pasta - if they might have the same port excluded for multiple different reasons, they have to explicitly deduplicate the list, rather than just list everything on the command line. So, don't give this error, let a port be excluded as many times as you like. Signed-off-by: David Gibson --- conf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/conf.c b/conf.c index 7a3085b7..e5baf8ee 100644 --- a/conf.c +++ b/conf.c @@ -355,12 +355,8 @@ static void conf_ports(const struct ctx *c, char optname, const char *optarg, if ((*p != '\0') && (*p != ',')) /* Garbage after the range */ goto bad; - for (i = xrange.first; i <= xrange.last; i++) { - if (bitmap_isset(exclude, i)) - die("Overlapping excluded ranges %s", optarg); - + for (i = xrange.first; i <= xrange.last; i++) bitmap_set(exclude, i); - } } while ((p = next_chunk(p, ','))); if (ifname && c->no_bindtodevice) { -- 2.53.0