Re: [PATCH 13/18] conf: Rework stepping through chunks of port specifiers

David Gibson
2026-04-09T00:48:04Z

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

On Wed, Apr 08, 2026 at 11:40:22PM +0200, Stefano Brivio wrote:
> On Tue, 7 Apr 2026 13:16:25 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
> > Port specifier strings are made up of ',' separated chunks. Rework the
> > logic we use to step through the chunks.
> >
> > Specifically, maintain a pointer to the end of each chunk as well as the
> > start. This is not really used yet, but will be useful in future.
> >
> > This also has side effect on semantics. Previously an empty specifier (0
> > chunks) was not accepted. Now it is, and will be treated as an "exclude
> > only" spec which excludes only ephemeral ports.
>
> Not really, because getopt_long() wants an argument for those options
> anyway.

This allows an *empty* specifier, not a missing one. i.e.
$ pasta -t '' -u ''

That's a kind of weird thing to do, but it does work after this patch.

--
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]