Skip to content

[v8.x backport] dns: fix crash while setting server during query

Backport of https://github.com/nodejs/node/pull/14891

Fix this issue follow these two points:

  1. Keep track of how many queries are currently open. If setServers() is called while there are open queries, error out.
  2. For Resolver instances, use option 1. For dns.setServers(), just create a fresh new default channel every time it is called, and then set its servers list.

Fixes: https://github.com/nodejs/node/issues/14734

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

dns, cares

Merge request reports

Loading