Re:IPv4 addresses are silly, inet_aton(3) doubly so
by colejohnson66 on Wednesday November 03, 2021 @08:18AM
(#29093587)
So instead of allowing octal addresses (as I assume the spec allows), they outright disable it?
[ Parent
| on HN ]
Re:IPv4 addresses are silly, inet_aton(3) doubly so
by Sharlin on Wednesday November 03, 2021 @08:45AM
(#29093809)
The IPv4 spec does not mention octal (or hexadecimal) notation at all; allowed forms are purely determined by individual APIS or user interfaces. POSIX `inet_addr` (and non-POSIX `inet_aton`) support nondecimal notation; the more recent POSIX `inet_pton` does not (but supports both IPv4 and IPv6 addresses). Support of oct and hex notation in the older APIs is mostly a historical accident. RFC 6943 recommends only supporting what they call "strict format" in newly written code [1].
[1] https://datatracker.ietf.org/doc/html/rfc6943#section-3.1.1