Skip to content

Commit 4fd14e5

Browse files
authored
Merge pull request #649 from keigoi/fix-issue-509-try2
Fix(DNS): Handle EAI_NODATA as success (empty address list) in getaddrinfo
2 parents 5ae554c + 13fb1c5 commit 4fd14e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/hostnet/host.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,10 @@ module Dns = struct
12671267
let getaddrinfo node family =
12681268
Luv_lwt.in_luv (fun return ->
12691269
Luv.DNS.getaddrinfo ~family ~node () (function
1270+
| Error `EAI_NODATA ->
1271+
(* Special handling for EAI_NODATA: Treat as success (host exists, but no address data) and
1272+
Return an empty list. See https://github.com/moby/moby/issues/47628 for more context. *)
1273+
return (Ok [])
12701274
| Error err -> return (Error (`Msg (Luv.Error.strerror err)))
12711275
| Ok x ->
12721276
let ips =

0 commit comments

Comments
 (0)