Fix TCP fallback with multiple nameservers [Bug #8285]
Originally reported here https://bugs.ruby-lang.org/issues/8285, but the patch has never been finalized.
We stumbled on the same issue under the following conditions:
- Multiple nameservers are configured for Resolv::DNS
- A nameserver falls back from UDP to TCP requester due to the message size
- TCP request hits
Resolv::DNStimeout -
Resolv::DNSretries the next nameserver
Expected result:
Resolv::DNS successfully falls back to the next nameserver, using TCP request.
Actual result:
Resolv::DNS::Requester::RequestError: host/port don't match is raised.
This pull request:
- Finalizes original patch proposed by @jmehnle.
- Adds a test case for the scenario above.
@sorah, @nobu any chance this can be reviewed?
@hanazuki These are valid points. Thank you for the detailed explanation. I've added your commit to this pull request. Thanks for looking into it.
@hanazuki any chance this fix can be merged?
+1 to merge. I'm not the maintainer and cannot merge or approve PRs.
What do you think, @sorah @nobu?
Any thoughts ☝️ @sorah, @nobu, @hsbt?