Closed Bug 1648539 Opened 4 years ago Closed 4 years ago

Differentiate between NXDOMAIN and network failure for getaddrinfo

Categories

(Core :: Networking: DNS, task, P1)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: valentin, Assigned: valentin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged][trr])

When calling PR_GetAddrInfoByName we should be able to differentiate between NXDOMAIN and a network failure.

We should check the PR_SetError result to see if they show up as different codes.

I've tested what PR_GetOSError returns for NXDOMAIN vs when the network is unreachable.

On Linux we get -2 (EAI_NONAME) for NXDOMAIN, and -3 (EAI_AGAIN) when the network is down.
However, on Windows, we always get 11001 (WSAHOST_NOT_FOUND) for both NXDOMAIN and network failure.

I don't think we have an easy way to fix this.
Dragana, what do you think?

Flags: needinfo?(dd.mozilla)

This error is coming from the system call? I am asking because I know cases where (nspr transforms some errors )

Flags: needinfo?(dd.mozilla)

Yes, it comes from the system call to getaddrinfo here

Blocks: doh

We've determined that this impossible to differentiate given how the current DNS API works.
In the next iteration we might have a better way to do this, or if we end up implementing a Do53 resolver.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.