public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Jon Maloy <jmaloy@redhat.com>
Cc: dgibson@redhat.com, david@gibson.dropbear.id.au, passt-dev@passt.top
Subject: Re: [PATCH v10] conf: Support CIDR notation for -a/--address option
Date: Thu, 12 Feb 2026 21:09:34 +0100 (CET)	[thread overview]
Message-ID: <20260212210932.3fb8abff@elisabeth> (raw)
In-Reply-To: <20260210231845.1107905-1-jmaloy@redhat.com>

Thanks for following up, the patch looks good to me, except for the
trivial conflict on ip.c which I already reported on v9 (but I can fix
it myself).

Just one thing I'm not sure about:

On Tue, 10 Feb 2026 18:18:45 -0500
Jon Maloy <jmaloy@redhat.com> wrote:

> We extend the -a/--address option to accept addresses in CIDR notation
> (e.g., 192.168.1.1/24 or 2001:db8::1/64) as an alternative to using
> separate -a and -n options.
> 
> We add a new inany_prefix_pton() helper function that:
> - Parses address strings with a compulsory /prefix_len suffix
> - Validates prefix length based on address family (0-32 for IPv4,
>   0-128 for IPv6), including handling of IPv4-to-IPv6 mapping case.
> 
> For IPv4, the prefix length is stored in ip4.prefix_len when provided.
> Mixing -n and CIDR notation results in an error to catch likely user
> mistakes.

...is this intended at this point:

---
$ ./pasta --config-net -a 2600::/42 ip -6 a s scope global
2: enp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65520 state UNKNOWN qlen 1000
    inet6 2600::/64 scope global nodad 
       valid_lft forever preferred_lft forever
---

?

because yes, I see we don't store the prefix length, and I've been
suggesting that always using /64 for IPv6 might make sense regardless
of what we see on the host or what the user configures.

But the new usage text, as well as the man page, seem to suggest that
the prefix length would be taken into account for IPv6 addresses as
well.

If this is something that goes away in a newer version of your other
series, I don't see a problem with it. I just thought I would ask if
this is intended, first, before applying this.

-- 
Stefano


      reply	other threads:[~2026-02-12 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10 23:18 Jon Maloy
2026-02-12 20:09 ` Stefano Brivio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260212210932.3fb8abff@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgibson@redhat.com \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).