Closed Bug 1673364 Opened 1 year ago Closed 1 year ago

nsHostResolver::InitLoopbackRecord should not call GetAddrInfo

Categories

(Core :: Networking: DNS, defect, P1)

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox82 --- unaffected
firefox83 --- unaffected
firefox84 --- fixed

People

(Reporter: valentin, Assigned: valentin)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [necko-triaged])

Attachments

(2 files)

As pointed out in phabricator it seems nsHostResolver::InitLoopbackRecord calls GetAddrInfo which is not OK, as that:

  1. Defeats the purpose of having a loopback record if we still use the system resolver to get it
  2. Blocks the calling thread until the record is resolved, which is even worse.

Instead we should construct and addrInfo directly like here

The test was using network.dns.localDomains to check that we don't
call into the platform DNS resolver when the network.dns.disabled pref
was set - but since the localDomains pref rewrites hostnames to localhost
and we now don't call into GetAddrInfo for local domains, the test
failed.
I changed it so it uses the NativeDNSResolverOverride to register an IP for
foo.bar instead of relying on localDOmains.

Depends on D94726

Blocks: 1670146
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/376f50682766
nsHostResolver::InitLoopbackRecord should not call GetAddrInfo r=necko-reviewers,dragana
https://hg.mozilla.org/integration/autoland/rev/6df4ac02675f
fix test_dns_disabled.js r=necko-reviewers,dragana
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Attachment #9183753 - Attachment description: Bug 1673364 - fix test_dns_disabled.js r=#necko → Bug 1673364 - fix test_dns_disabled.js

Set release status flags based on info from the regressing bug 1220810

You need to log in before you can comment on or make changes to this bug.