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=BcN8fsSE; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 3550E5A065D for ; Mon, 23 Mar 2026 09:32:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1774254767; bh=YRGwJEMXR6RyqdV8lZdJwygfa6FNE59zwH9+VnSRUEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BcN8fsSEG/G1MvbHM5yGWqyTzUyQrLGXalKYwRrUebZx2ugT1HGQsQq9y3esPql2G bEY/zRani2Rk9dqTM6bFiqwffGWwVVIdZ+4Cbr7K+TwSRghkYNUjPR4Rc4xy2knXA4 FLjm0+Bj0pDv3ZfXE5koO0BZQNGL1gLkflzXVA+5j5LFRY3ulcW675YhgkX0Hv/G5V hsvhQ0u3EfH0fq+hzarv8E93EEuCuRxowgxJUh8z7GEeamSVnhUlk7GTOT3UylHGQu f+swW8SpEN121upJRHvZmWd7BdqENrU/b37tPElCeoI5/Jm3pgjGRQJZDr8uXCyJIq QR89ab4cnJviw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ffRHz4g3Wz4wHj; Mon, 23 Mar 2026 19:32:47 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v3 10/25] conf: Don't bother complaining about overlapping excluded ranges Date: Mon, 23 Mar 2026 18:37:17 +1100 Message-ID: <20260323073732.3158468-11-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323073732.3158468-1-david@gibson.dropbear.id.au> References: <20260323073732.3158468-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: M33T3ONJBISI2F6N5J26U4GZLSWX7PBN X-Message-ID-Hash: M33T3ONJBISI2F6N5J26U4GZLSWX7PBN 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