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=biZ0FUqm; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id BBC735A0272 for ; Thu, 09 Apr 2026 02:48:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1775695681; bh=xqWz6sXiHOoA/1zs95cspbWMAOs15TKCSV5Idf3UBLg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=biZ0FUqml3pUvGT2XoikViZv1rCX3La+yvEMbCMXZYNojEQ1V0ploG6Q3Q9YuWq1/ Q1HjWslDqLyxHk21ZnseSVTDPgDo9ovMioRpYwnhRWC/nD7qXnewFpV4eBNFnewb3/ 0c7XqMcZxKnE12c08XGjABHjYj9EEYFInd3GrV8m618WX4BBIp5Ifbo25tFQU/ZAXt YioqQwL/WZMIr0nTYlF6e8zSFzkMuH4JEV7+kK3ZqNpijb/jdDeCdhONl1rzQCq2Er BPMBHQxWa86VC+MxLzia8JNOXW8Ah73U0xIP9PUtWQqAHS6sk0bOVbk66dBvNtcOL6 STGfP8yGDuNrA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4frh9s2YwTz4whx; Thu, 09 Apr 2026 10:48:01 +1000 (AEST) Date: Thu, 9 Apr 2026 10:15:45 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 14/18] conf: Rework checking for garbage after a range Message-ID: References: <20260407031630.2457081-1-david@gibson.dropbear.id.au> <20260407031630.2457081-15-david@gibson.dropbear.id.au> <20260408234026.70cdaa03@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NVuZAJdYzq40sP9U" Content-Disposition: inline In-Reply-To: <20260408234026.70cdaa03@elisabeth> Message-ID-Hash: ZAD6MCRKUAJVERXT5MU73LTVOBEGW4O3 X-Message-ID-Hash: ZAD6MCRKUAJVERXT5MU73LTVOBEGW4O3 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: 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: --NVuZAJdYzq40sP9U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 08, 2026 at 11:40:27PM +0200, Stefano Brivio wrote: > On Tue, 7 Apr 2026 13:16:26 +1000 > David Gibson wrote: >=20 > > After parsing port ranges conf_ports_spec() checks if we've reached a > > chunk delimiter (',') to verify that there isn't extra garbage there. > > Rework how we do this to use the recently introduces chunk-end pointer. >=20 > Nit: introduced >=20 > > This has two advantages: > >=20 > > 1) Small, but practical: we don't need to repeat what the valid delimit= ers > > are, that's already handled in the chunk splitting code. > >=20 > > 2) Large, if theoretical: this will also given an error if port parsing > > overruns a chunk boundary. We don't really expect that to happen, b= ut > > it would give very confusing behaviour if it did. strtoul(3), on wh= ich > > parse_port_range() is based does say it may accept thousands separat= ors > > based on locale which means can't entirely be sure it will only acce= pt >=20 > Nit: we can't Both fixed. Plus a few more errors fixed and some edits for brevity. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --NVuZAJdYzq40sP9U Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmnW77AACgkQzQJF27ox 2GcuDRAAlxnhk2w9Ks1QiCB6di8HAfzULeQafENNLd1paaabJenwMawmdwXjcpsD nb0qG2X69vzdTzVC04Oc6cD/I5ZCmPv/uZXmyXzdauxsou3JwmB7ys4J6idVk+Jb rhOhmcTMpy8Es5HkK9RlV3k0z5jemC0juIFawiytE3cFhw1+3Og3pIYEXarsEmqf GXyq0SVLhuyEQfHWsmepZsmLvF03wnexFhMWAnYeCLnleinvspOb0lIoHVQpJXNQ MLwETSjYZGXJohMd5LywG/AlJAPJ2uxUgH4l8USDjVVxQMJGJKirLpq9wPuU/jST P0aDmmMuBIAJH/qo7HHCV45+gJnOobBt5//rz1ORviRZjBowVQvrZullKBXGsZNr Fffs0iXYyrO6ZksU7QbNpMgWWwgd/M7Rpodw/nC6nxCJ3ROift70jo54lrVKsqBy bJu7AwthYvGA3ZDJJyCg66rg8I8rOmQpWFtJusohXX2+a+D5VcSknfuHA4EumAqf vGZK6PoCUDEQSVc5Dx3SRN0bxSBaH+kBPDGDgAtel/H5NylTI0YF7EKEwtITHlJp Z2RxfEWEgvVM33MQslVwSnpNFBSNHPwyQiudTczS6fE5izPrBJ7wzFFquCO4SXdJ /bnbVbrmPuHMfDLsYPFKTh6dg3tMJ+AkkLb16PYJeeGNkb09zEU= =XSzS -----END PGP SIGNATURE----- --NVuZAJdYzq40sP9U--