On Thu, Dec 18, 2025 at 05:22:13PM -0500, Jon Maloy wrote: > Update the man page to document the new CIDR notation support: > > - Update -a/--address to show addr[/prefix_len] syntax > - Document that prefix length (0-32) can be appended for IPv4 > - Note that mixing CIDR notation with -n results in an error > - Update -n/--netmask to mention CIDR alternative > > Signed-off-by: Jon Maloy I don't see much reason to keep this a separate patch from the previous one. > --- > passt.1 | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/passt.1 b/passt.1 > index db0d662..117239f 100644 > --- a/passt.1 > +++ b/passt.1 > @@ -156,10 +156,14 @@ By default, the advertised MTU is 65520 bytes, that is, the maximum 802.3 MTU > minus the length of a 802.3 header, rounded to 32 bits (IPv4 words). > > .TP > -.BR \-a ", " \-\-address " " \fIaddr > +.BR \-a ", " \-\-address " " \fIaddr\fR[\fB/\fR\fIprefix_len\fR] > Assign IPv4 \fIaddr\fR via DHCP (\fByiaddr\fR), or \fIaddr\fR via DHCPv6 (option > 5) and an \fIaddr\fR-based prefix via NDP Router Advertisement (option type 3) > for an IPv6 \fIaddr\fR. > +For IPv4 addresses, an optional \fB/\fR\fIprefix_len\fR (0-32) can be > +appended in CIDR notation (e.g., 192.168.1.1/24). This is an alternative to > +using the \fB-n\fR, \fB--netmask\fR option. Mixing CIDR notation with > +\fB-n\fR results in an error. This seems to imply that the CIDR notation is only for Ipv4, which is not what's implemented. > This option can be specified zero (for defaults) to two times (once for IPv4, > once for IPv6). > By default, assigned IPv4 and IPv6 addresses are taken from the host interfaces > @@ -172,7 +176,9 @@ is assigned for IPv4, and no additional address will be assigned for IPv6. > .TP > .BR \-n ", " \-\-netmask " " \fImask > Assign IPv4 netmask \fImask\fR, expressed as dot-decimal or number of bits, via > -DHCP (option 1). > +DHCP (option 1). Alternatively, the prefix length can be specified using CIDR > +notation with the \fB-a\fR, \fB--address\fR option (e.g., \fB-a\fR 192.168.1.1/24). > +Mixing \fB-n\fR with CIDR notation results in an error. > By default, the netmask associated to the host address matching the assigned one > is used. If there's no matching address on the host, the netmask is determined > according to the CIDR block of the assigned address (RFC 4632). Pre-existing, but this seems a bit misleading. If we *don't* specify -a, then, yes, the netmask will be copied from the host, along with the address. If we specify a specific address with -a, I think we'll always use the network class (which is rarely useful these days), even if the specified address happens to be one that's on the host. -- 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