basic/in-addr-util: drop check for prefix length in formatting function
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 3 Jun 2022 13:49:40 +0000 (15:49 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 6 Jun 2022 07:52:52 +0000 (09:52 +0200)
commit61af1813446ced383490fac93e31d6ea3fd5d178
tree794303862e894bd2a3664af3dd4fb7bcddddc7de
parentdd6d433a4fddac424db6790c08532dd04babe35b
basic/in-addr-util: drop check for prefix length in formatting function

The general rule should be to be strict when parsing data, but lenient
when printing it. Or in other words, we should verify data in verification
functions, but not when printing things. It doesn't make sense to refuse
to print a value that we are using internally.

We were tripping ourselves in some of the print functions:
we want to report than an address was configured with too-long prefix, but
the log line would use "n/a" if the prefix was too long. This is not useful.

Most of the time, the removal of the check doesn't make any difference,
because we verified the prefix length on input.
src/basic/in-addr-util.c
src/test/test-in-addr-prefix-util.c
src/test/test-in-addr-util.c