Skip to content

Correctly return NOERROR even if host resolver returned empty list#645

Merged
djs55 merged 1 commit intomoby:masterfrom
dan0dbfe:fix/issue-509
Apr 1, 2025
Merged

Correctly return NOERROR even if host resolver returned empty list#645
djs55 merged 1 commit intomoby:masterfrom
dan0dbfe:fix/issue-509

Conversation

@dan0dbfe
Copy link
Copy Markdown
Contributor

@dan0dbfe dan0dbfe commented Nov 19, 2024

Fixes #509 and moby/moby#47628.

  1. Dns.resolve now returns (rr list, unit) result to distinguish between [] resulting from NOERROR or NXDOMAIN.
    • Currently only returns NXDOMAIN on any kind of error.
    • Dns.getaddrinfo returns (rr list, Msg) result with no error handling just like current behavior
  2. Make.answer returns answers (including []) if there is no error, otherwise NXDOMAIN is returned.
  3. Added NOERROR and NXDOMAIN test cases.

@dan0dbfe dan0dbfe force-pushed the fix/issue-509 branch 4 times, most recently from 7ea18b6 to 14556e2 Compare November 19, 2024 16:10
Signed-off-by: dan0dbfe <2209822+dan0dbfe@users.noreply.github.com>
@dan0dbfe dan0dbfe marked this pull request as ready for review November 19, 2024 16:17
@dan0dbfe
Copy link
Copy Markdown
Contributor Author

The "usual" tests in ocaml-ci seem to be green and the rest of the CI failures seem unrelated

@candrews
Copy link
Copy Markdown

What are the next steps on merging this fix?

I'm happy to help if I can :)

in
run ~pcap:"test_etc_hosts_priority.pcap" t

let test_noerror_empty_response server config () =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding test cases!

@djs55
Copy link
Copy Markdown
Collaborator

djs55 commented Apr 1, 2025

Thanks, builds and looks ok to me. I'll merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VPNKit DNS server returns NXDOMAIN for SRV records

3 participants