Commit 31b2a0a
committed
Auto merge of #41582 - jonhoo:reread-nameservers-on-lookup-fail, r=alexcrichton
Reload nameserver information on lookup failure
As discussed in #41570, UNIX systems often cache the contents of `/etc/resolv.conf`, which can cause lookup failures to persist even after a network connection becomes available. This patch modifies lookup_host to force a reload of the nameserver entries following a lookup failure. This is in line with what many C programs already do (see #41570 for details). On systems with nscd, this should not be necessary, but not all systems run nscd.
Fixes #41570.
Depends on rust-lang/libc#585.
r? @alexcrichton2 files changed
+17
-4
lines changed- Cargo.lock+2-2
- Cargo.toml+1-1
- README.md+19
- appveyor.yml+1-1
- ci/run-docker.sh-2
- libc-test/build.rs+16
- src/unix/bsd/mod.rs+2
- src/unix/mod.rs+17
- src/unix/notbsd/android/b64/mod.rs+1-1
- src/unix/notbsd/android/mod.rs+12
- src/unix/notbsd/linux/mips/mips32.rs+1-1
- src/unix/notbsd/linux/mips/mips64.rs+1-1
- src/unix/notbsd/linux/mips/mod.rs+1
- src/unix/notbsd/linux/mod.rs+37
- src/unix/notbsd/linux/musl/mod.rs+2-1
- src/unix/notbsd/linux/other/b32/arm.rs+1
- src/unix/notbsd/linux/other/b32/powerpc.rs+1
- src/unix/notbsd/linux/other/b32/x86.rs+1
- src/unix/notbsd/linux/other/b64/aarch64.rs+1
- src/unix/notbsd/linux/other/b64/powerpc64.rs+1
- src/unix/notbsd/linux/other/b64/sparc64.rs+1
- src/unix/notbsd/linux/other/b64/x86_64.rs+1
- src/unix/notbsd/linux/other/mod.rs+1-1
- src/unix/notbsd/linux/s390x.rs+2-1
- src/unix/solaris/mod.rs+113-45
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
183 | 196 | | |
184 | 197 | | |
185 | 198 | | |
| |||
0 commit comments