Page MenuHomeFreeBSD

libc/resolv: Switch default to loopback address
ClosedPublic

Authored by des on Jan 31 2026, 12:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 16, 8:26 AM
Unknown Object (File)
Fri, Jun 5, 4:37 PM
Unknown Object (File)
Fri, Jun 5, 8:53 AM
Unknown Object (File)
Thu, Jun 4, 9:03 AM
Unknown Object (File)
Wed, Jun 3, 10:50 PM
Unknown Object (File)
Wed, Jun 3, 6:29 PM
Unknown Object (File)
Tue, Jun 2, 10:53 AM
Unknown Object (File)
Mon, Jun 1, 9:59 AM
Subscribers

Details

Summary

If no resolver configuration was found, we would fall back to INADDR_ANY
and IN6ADDR_ANY. This made sense when it was first written thirty or
forty years ago but not today, especially since connecting to INADDR_ANY
or IN6ADDR_ANY is no longer supported. Switch to the loopback address
and simplify the code.

Note that (as the pre-existing comment in the code states) running
without a resolver configuration is not really supported. Still, if
we're going to have a hardcoded fallback, it might as well work.

PR: 291790
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable