[pmg-devel] [PATCH pmg-api v2] fix #4410: Remove non-null host-bits from CIDR when reading `mynetworks`

Christoph Heiss c.heiss at proxmox.com
Wed Dec 28 11:17:15 CET 2022


On Wed, Dec 28, 2022 at 10:51:21AM +0100, Stoiko Ivanov wrote:
> [..]
>
> One option that came to my mind was ... just keeping the API part and the
> values in /etc/pmg/mynetworks as they are ..
> only normalize the prefixes in get_template_vars for use in the postfix
> config
>
> It has the downside of users getting different values there than they
> entered - but I personally never understood why programs forced me to
> clear out the host-bits for their use - so I'm not sure if there's any
> upside to requiring our users to clear that up?
One upside I can think of would be that users cannot _that_ easily typo
the prefix, since they need to match up the prefix length to the network
address. Then again, we can only do so much if someone puts in wrong
values.

But otherwise, the above suggestion seems very reasonable to me. I don't
think a whole lot of users will read the postfix config directly anyway
(why would they?), so IMHO that is a non-issue anyway if the values
differ.
I'll try it out and send a v3 with the above implemented, maybe it is
the better way in the end anyway.

> > [..]
> >
> > Removing it would change the API though - is stability / backwards
> > compatibility something we have to be wary of or can I just drop it if
> > it's really not used anywhere?
> good point! - we do return it from the API - so let's keep it for now
> (a 'FIXME: drop network_address and prefix_size with PMG 8.0' comment
> might make sense though - then we can clear it up with the next major
> release)
Ack, I'll just add a comment and leave it as it is for now.





More information about the pmg-devel mailing list