commit | db04a2bd0a35d6e74101535adffb5c8dab223fa7 | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Tue Apr 27 14:21:03 2021 +0800 |
committer | Mike Yu <yumike@google.com> | Wed Apr 28 16:53:01 2021 +0800 |
tree | b8b9686b16fa69241e419be0892ea770f5739904 | |
parent | 82ae84b9490e898eb839d0b807de23da27437c5b [diff] |
Retry binding sockets in DNSResponder if errno is EADDRNOTAVAIL Tests fail in DNSResponder::startServer() when DNSResponder is binding the socket while the address is still being set up. This change provides a simple fix to address this problem because the tests are unaware of onInterfaceAddressUpdated. Below is a real failure log: // device log 04-22 00:29:07.854 root 802 802 I netd : interfaceAddAddress("testtun10002", "2001:db8:2::202", 128) <1.51ms> 04-22 00:29:07.855 root 6745 6745 E DNSResponder: failed to bind UDP 2001:db8:2::202:53: Cannot assign requested address // dumpsys netd 04-22 00:29:07.857 onInterfaceAddressUpdated(2001:db8:2::202/128, testtun10002, 128, 0) (0.04ms) Bug: 186181084 Bug: 175269391 Test: run ResolverMultinetworkTest.GetAddrInfo_AI_ADDRCONFIG 100 times Change-Id: I8e8824c9056bd298e0e689adfbc720abaa45fcd4
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.