moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.11k stars 190 forks source link

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

Open dan0dbfe opened 3 days ago

dan0dbfe commented 3 days ago

Fixes #509 and https://github.com/moby/moby/issues/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 commented 1 day ago

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