[Bug 258874] route add -inet 240/4 results in 0.0.0.0/4 127.0.0.1 UGRS lo0

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 07 Jan 2024 19:21:02 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258874

--- Comment #11 from Mike Karels <karels@freebsd.org> ---
(In reply to paul vixie from comment #10)
I hadn't realized that inet_pton required 4 components; it took a search in the
man page to find that in the standards section.  The man page should be
clarified, in particular the INTERNET ADDRESSES section, to say which functions
use these conventions.

> so, i never liked this or understood it, and i did not preserve this syntax in inet_pton(), but it's still documented, and i think we ought to either make sure it isn't documented and never works anywhere, or that "route" should support it.

It's far too late to change inet_aton(), etc; they have had this behavior for
40 years, and it is in the other BSDs too.  In fact, route uses inet_aton(),
and supports this behavior.  It just isn't the behavior that some people
expect.  Worse, as noted in comment 6, route had special code to "do what I
mean" and shifted the address until the most-significant octet was non-zero. 
That was removed from route about 13.x.  When this bug was first opened in
2021, I thought that we should restore that behavior to avoid breaking things. 
However, it has been long enough that most people have adapted.  Now I think we
should detect the incorrect values and fail, rather than doing something
nonsensical.  Unfortunately, we had neither change in place for 13.2 or 14.0,
and now there are new people upgrading from 12.x now that it is EOL.

-- 
You are receiving this mail because:
You are the assignee for the bug.