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)
Fri, Oct 2, 2:55 PM
Unknown Object (File)
Fri, Oct 2, 2:55 PM
Unknown Object (File)
Fri, Oct 2, 2:48 PM
Unknown Object (File)
Sun, Sep 13, 10:28 PM
Unknown Object (File)
Sat, Sep 12, 8:46 AM
Unknown Object (File)
Wed, Sep 9, 3:31 PM
Unknown Object (File)
Wed, Sep 9, 8:24 AM
Unknown Object (File)
Tue, Sep 8, 9:15 PM
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