netxlite: call getaddrinfo and handle platform-specific oddities (#764)
This commit changes our system resolver to call getaddrinfo directly when CGO is enabled. This change allows us to: 1. obtain the CNAME easily 2. obtain the real getaddrinfo retval 3. handle platform specific oddities such as `EAI_NODATA` returned on Android devices See https://github.com/ooni/probe/issues/2029 and https://github.com/ooni/probe/issues/2029#issuecomment-1140258729 in particular. See https://github.com/ooni/probe/issues/2033 for documentation regarding the desire to see `getaddrinfo`'s retval. See https://github.com/ooni/probe/issues/2118 for possible follow-up changes.
This commit is contained in:
parent
62bd62ece1
commit
cf6dbe48e0
36 changed files with 1259 additions and 59 deletions
|
|
@ -26,6 +26,7 @@ func TestSummarize(t *testing.T) {
|
|||
probeSSLInvalidHost = netxlite.FailureSSLInvalidHostname
|
||||
probeSSLInvalidCert = netxlite.FailureSSLInvalidCertificate
|
||||
probeSSLUnknownAuth = netxlite.FailureSSLUnknownAuthority
|
||||
probeAndroidEaiNoData = netxlite.FailureAndroidDNSCacheNoData
|
||||
tcpIP = "tcp_ip"
|
||||
trueValue = true
|
||||
)
|
||||
|
|
@ -68,7 +69,7 @@ func TestSummarize(t *testing.T) {
|
|||
Status: webconnectivity.StatusAnomalyControlUnreachable,
|
||||
},
|
||||
}, {
|
||||
name: "with non-existing website",
|
||||
name: "with non-existing website (NXDOMAIN case)",
|
||||
args: args{
|
||||
tk: &webconnectivity.TestKeys{
|
||||
DNSExperimentFailure: &probeNXDOMAIN,
|
||||
|
|
@ -84,6 +85,23 @@ func TestSummarize(t *testing.T) {
|
|||
Status: webconnectivity.StatusSuccessNXDOMAIN |
|
||||
webconnectivity.StatusExperimentDNS,
|
||||
},
|
||||
}, {
|
||||
name: "with non-existing website (Android EAI_NODATA case)",
|
||||
args: args{
|
||||
tk: &webconnectivity.TestKeys{
|
||||
DNSExperimentFailure: &probeAndroidEaiNoData,
|
||||
DNSAnalysisResult: webconnectivity.DNSAnalysisResult{
|
||||
DNSConsistency: &webconnectivity.DNSConsistent,
|
||||
},
|
||||
},
|
||||
},
|
||||
wantOut: webconnectivity.Summary{
|
||||
BlockingReason: nil,
|
||||
Blocking: false,
|
||||
Accessible: &trueValue,
|
||||
Status: webconnectivity.StatusSuccessNXDOMAIN |
|
||||
webconnectivity.StatusExperimentDNS,
|
||||
},
|
||||
}, {
|
||||
name: "with NXDOMAIN measured only by the probe",
|
||||
args: args{
|
||||
|
|
|
|||
Loading…
Reference in a new issue