From: Crystal Kolipe Subject: Re: netstat(1): get rid of inet_aton To: tech@openbsd.org Date: Mon, 12 Aug 2024 06:37:33 -0300 On Mon, Aug 12, 2024 at 11:18:19AM +0200, Claudio Jeker wrote: > On Mon, Aug 12, 2024 at 06:02:37AM -0300, Crystal Kolipe wrote: > > On Mon, Aug 12, 2024 at 08:32:48AM +0200, Florian Obser wrote: > > > On 2024-08-12 00:07 +02, Kirill A. Korinsky wrote: > > > > Am I missing the place where 127.0.0.1 is required to be the only possible > > > > localhost address? > > > > > > > > > > The commit message quotes this: > > > > > > RFC 6761, 6.3 Domain Name Reservation Considerations for "localhost.": > > > 3. Name resolution APIs and libraries SHOULD recognize localhost > > > names as special and SHOULD always return the IP loopback address > > > for address queries and negative responses for all other query > > > types. Name resolution APIs SHOULD NOT send queries for > > > localhost names to their configured caching DNS server(s). > > > > > > Now, you could hagle a bit what "the IP loopback address" actually > > > means. On OpenBSD it means 127.0.0.1 for IPv4 and ::1 for IPv6. > > > > A somewhat related discussion came up on -tech back in 2022: > > > > https://marc.info/?l=openbsd-tech&m=165377078102153&w=2 > > No, it is not related. It does not talk about using anything else than > 127.0.0.1 as localhost loopback address. 127.0.0.1 is required to exist > and be the loopback end of story. > > Some people would like to recover the rest of 127/8 for other use. Exactly, which is why it is related to Krill's point about using parts of 127/8 as additional loopbacks. You can't reliably do both, and obviously the only sensible answer is what OpenBSD has long adopted and restrict special localhost processing in IPv4 specifically to 127.0.0.1. And obviously fully embrace IPv6 instead of finding creative uses for 127/8.