Page MenuHomeFreeBSD

libc/resolv: Switch default to loopback address
ClosedPublic

Authored by des on Jan 31 2026, 12:00 PM.
Tags
None
Referenced Files
F163424380: D55011.id.diff
Thu, Jul 23, 2:29 AM
F163424372: D55011.id.diff
Thu, Jul 23, 2:29 AM
F163380175: D55011.id170846.diff
Wed, Jul 22, 4:45 PM
Unknown Object (File)
Mon, Jul 20, 11:57 PM
Unknown Object (File)
Sun, Jul 19, 2:50 AM
Unknown Object (File)
Wed, Jul 15, 7:05 AM
Unknown Object (File)
Wed, Jul 15, 7:05 AM
Unknown Object (File)
Jun 22 2026, 7:48 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 70284
Build 67167: arc lint + arc unit