qemu-e2k/slirp
Ed Swierk df7a86ed73 slirp: Read host DNS config on demand
Currently the qemu user-mode networking stack reads the host DNS
configuration (/etc/resolv.conf or the Windows equivalent) only once
when qemu starts.  This causes name lookups in the guest to fail if the
host is moved to a different network from which the original DNS servers
are unreachable, a common occurrence when the host is a laptop.

This patch changes the slirp code to read the host DNS configuration on
demand, caching the results for at most 1 second to avoid unnecessary
overhead if name lookups occur in rapid succession.  On non-Windows
hosts, /etc/resolv.conf is re-read only if the file has been replaced or
if its size or mtime has changed.

Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:46:58 -05:00
..
COPYRIGHT
bootp.c
bootp.h
cksum.c
debug.h
if.c
if.h
ip.h rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN 2009-07-27 14:09:21 -05:00
ip_icmp.c slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
ip_icmp.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
ip_input.c
ip_output.c
libslirp.h slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
main.h slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
mbuf.c
mbuf.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
misc.c
misc.h slirp: Remove UDP protocol emulation (talk, cuseeme) 2009-07-27 14:09:15 -05:00
sbuf.c
sbuf.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
slirp.c slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
slirp.h slirp: Use monotonic clock if available (v2) 2009-07-27 14:09:15 -05:00
slirp_config.h rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN 2009-07-27 14:09:21 -05:00
socket.c slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
socket.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
tcp.h rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN 2009-07-27 14:09:21 -05:00
tcp_input.c
tcp_output.c
tcp_subr.c slirp: Read host DNS config on demand 2009-08-27 20:46:58 -05:00
tcp_timer.c More NULL pointer fixes 2009-08-01 10:13:20 +00:00
tcp_timer.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00
tcp_var.h
tcpip.h
tftp.c
tftp.h
udp.c slirp: Remove UDP protocol emulation (talk, cuseeme) 2009-07-27 14:09:15 -05:00
udp.h Fix breakage by obsolete _P() for good 2009-07-01 19:11:17 +00:00