From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OLM2pphe; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 8FBBF5A0265 for ; Wed, 08 Apr 2026 23:40:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775684441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SHir0NYZRjqzbWuzE+Gb+iinAffyl5mAmO7dFzHvlNc=; b=OLM2ppheBdMrG70b1eqzPU83pc8Nc6I9xyOLhMcw+Jtm8Oh7vE8o/36sHojk4KXf+iMb+D cdh34Cq9BFgRj/MenTSuQjatyK9yA2Xb+uT3eA6mPwMTmbw2WuQRwfp7up+CPybMcC/Tsq a+sctYgM7IlpKHKK4JWn5XBFyVf7PeY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-_XtudyQDOi2XWHVLWN77uA-1; Wed, 08 Apr 2026 17:40:40 -0400 X-MC-Unique: _XtudyQDOi2XWHVLWN77uA-1 X-Mimecast-MFC-AGG-ID: _XtudyQDOi2XWHVLWN77uA_1775684438 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-488b171f1a5so924065e9.0 for ; Wed, 08 Apr 2026 14:40:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775684437; x=1776289237; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SHir0NYZRjqzbWuzE+Gb+iinAffyl5mAmO7dFzHvlNc=; b=r6u7rFZD4tWeQ31U4NFP+ISJrGk4btQkqSoLhY1RjV2JDBBPQRTdEKneGUGjy+lIs2 QspRDS/FW64nar1C/jnrzLC9nEX9csPRnW0wFQgSCcWDYMPZx3E42y18DRM5JWZiPgQ5 9hDaJehy3u3xRkNwJZ34I6FIJnSHX6jnrwRKyNkJ/w1JhGLvrtLc1TSZGpML2Op3Dw1C +/UbZHP9Ne5c8VEDYZkg0Spqci4wlFHMtSrrFgq+0U++hjFSIGkaG36amo6vNrRhv6XA HptD+ztseuAmZK6e0KmaXxgCE6PnIlh5gVnUUHLkM71DVxTkvAAO/7VNRDMZ7QOKMZFc f0Vw== X-Gm-Message-State: AOJu0YyM4YptlAQ245HKZoT0AONzi9JYdgJ4uMf8ZIgZDwRLBJ7ZKX1R 28BFpw3IQ3VgJvS7N7Re4b6x14ChZJjFwQMudXY+Zxcjx3FbSX+LsY70nObNnFJ37f31qZktsgo a1LpC+z+Xk4Q2odLxrUIIp46I2k05JjfquWh8jbSIvo2VvAr47s6PLYayTOhjSg== X-Gm-Gg: AeBDiesOsl0r6X6j3Eqv4K1VHxI+Z0tuXuyo0VZ2/ueOzo2RaypH3o3SKwI8RwCkPRX dSkTD4X7ybFZOg2FI9w6kTbp8yg18L6OqIv+Cep89HitopVBWMm1/DJy7mkMZvqZV5vmdCNFyOo nmxiyZqfbh84UpX175rVMVuo3Hcz+fYhK0J0mEiMV1crAykh1aX6PpkO2rQiUY8QOa6vPg3v/an X7gGOIsCSQAwcSfb+4iMYl5LTqrLG/98S6ZU3A0s57Jp/Af8A/qJUDx/gQcZvf6YqZE2qejWbGf KJyB3Dxe3kBmkhBpctxP3fRlK1RPQ78txHe6QqouL42Wh9B5Fstw02Alkb1QbLNSzOxSOq3J9lW NTp0EZ5Gf1MVs8AQG500UmBswZgUkKuK+ X-Received: by 2002:a05:600c:5247:b0:488:b187:3c with SMTP id 5b1f17b1804b1-488b1870244mr178034665e9.14.1775684437294; Wed, 08 Apr 2026 14:40:37 -0700 (PDT) X-Received: by 2002:a05:600c:5247:b0:488:b187:3c with SMTP id 5b1f17b1804b1-488b1870244mr178034315e9.14.1775684436777; Wed, 08 Apr 2026 14:40:36 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e2c60a2sm59509816f8f.10.2026.04.08.14.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 14:40:35 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 15/18] conf: Move "all" handling to port specifier Message-ID: <20260408234034.6b934b2b@elisabeth> In-Reply-To: <20260407031630.2457081-16-david@gibson.dropbear.id.au> References: <20260407031630.2457081-1-david@gibson.dropbear.id.au> <20260407031630.2457081-16-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Wed, 08 Apr 2026 23:40:35 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: doGPau3jdaUqrB1lt_Rs9fBQ9NAgSgfgzx33MzlNeY0_1775684438 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 25WBKRMRTVEXJGY726PG3WQHBJKCSGYO X-Message-ID-Hash: 25WBKRMRTVEXJGY726PG3WQHBJKCSGYO X-MailFrom: sbrivio@redhat.com 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: passt-dev@passt.top 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: On Tue, 7 Apr 2026 13:16:27 +1000 David Gibson wrote: > Currently -[tTuU] all is handled separately in conf_ports() before calling > conf_ports_spec(). Earlier changes mean we can now move this handling to > conf_ports_spec(). This makes the code slightly simpler, but more > importantly it allows some useful combinations we couldn't previously do, > such as > -t 127.0.0.1/all > or > -u %eth2/all It would probably be good to update the man page at some point with this (we can also leave it undocumented for a while though, as it doesn't break any existing functionality). > > Signed-off-by: David Gibson > --- > conf.c | 18 +++++------------- > 1 file changed, 5 insertions(+), 13 deletions(-) > > diff --git a/conf.c b/conf.c > index 51612047..fcc75d25 100644 > --- a/conf.c > +++ b/conf.c > @@ -251,6 +251,11 @@ static void conf_ports_spec(const struct ctx *c, > const char *p, *ep; > unsigned i; > > + if (!strcmp(spec, "all")) { > + /* Treat "all" as equivalent to "": all non-ephemeral ports */ > + spec = ""; > + } > + > /* Mark all exclusions first, they might be given after base ranges */ > for_each_chunk(p, ep, spec, ",") { > struct port_range xrange; > @@ -372,19 +377,6 @@ static void conf_ports(const struct ctx *c, char optname, const char *optarg, > return; > } > > - if (!strcmp(optarg, "all")) { > - uint8_t exclude[PORT_BITMAP_SIZE] = { 0 }; > - > - /* Exclude ephemeral ports */ > - fwd_port_map_ephemeral(exclude); > - > - conf_ports_range_except(c, optname, optarg, fwd, > - proto, NULL, NULL, > - 1, NUM_PORTS - 1, exclude, > - 1, FWD_WEAK); > - return; > - } > - > strncpy(buf, optarg, sizeof(buf) - 1); > > if ((spec = strchr(buf, '/'))) { -- Stefano