summaryrefslogtreecommitdiffstats
path: root/slirp
Commit message (Collapse)AuthorAgeFilesLines
* Delayed IP packetsFabien Chouteau2011-08-035-37/+69
| | | | | | | | | | | | | In the current implementation, if Slirp tries to send an IP packet to a client with an unknown hardware address, the packet is simply dropped and an ARP request is sent (if_encap in slirp/slirp.c). With this patch, Slirp will send the ARP request, re-queue the packet and try to send it later. The packet is dropped after one second if the ARP reply is not received. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* Simple ARP tableFabien Chouteau2011-08-034-58/+168
| | | | | | | | This patch adds a simple ARP table in Slirp and also adds handling of gratuitous ARP requests. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* slirp: Fix unusual "comments" in unused codeStefan Weil2011-07-271-2/+2
| | | | | | | | | | | | | cppcheck detected two rather strange comments which were not correctly written as C comments. They did not cause any harm because they were framed by #ifdef notdef ... #endif, so they were never compiled. Fix them nevertheless (we could also remove the unused code). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Wrap recv to avoid warningsBlue Swirl2011-07-253-4/+4
| | | | | | | | | | | | | Avoid warnings like these by wrapping recv(): CC slirp/ip_icmp.o /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive': /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror] /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *' Remove also casts used to avoid warnings. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Forward ICMP echo requests via unprivileged socketsJan Kiszka2011-07-237-1/+147
| | | | | | | | | | | | Linux 3.0 gained support for unprivileged ICMP ping sockets. Use this feature to forward guest pings to the outer world. The host admin has to set the ping_group_range in order to grant access to those sockets. To allow ping for the users group (GID 100): echo 100 100 > /proc/sys/net/ipv4/ping_group_range Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Put forked exec into separate process groupJan Kiszka2011-07-231-1/+2
| | | | | | | | | | Recent smb daemons tend to terminate themselves via a process group SIGTERM. If the daemon is still in qemu's group by that time, qemu will die as well. Avoid this by always pushing fork_exec processes into a group of their own, not just (unused) type 2 execs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Replace m_freem with m_freeJan Kiszka2011-07-237-19/+16
| | | | | | | Remove this pointless wrapping. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Strictly associate DHCP/BOOTP and TFTP with virtual hostJan Kiszka2011-07-231-5/+8
| | | | | | | | Instead of accepting every DHCP/BOOTP and TFTP packet, only invoke the built-in servers if the target is the virtual host. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Fix restricted modeJan Kiszka2011-07-233-25/+6
| | | | | | | | | | | | This aligns the code to what the documentation claims: Allow everything but requests that would have to be routed outside of the virtual LAN. So we need to drop the unneeded IP-level filter, allow TFTP requests, and add the missing protocol-level filter to ICMP. CC: Gleb Natapov <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add a service to reap zombies, use it in SLIRPPaolo Bonzini2011-03-291-1/+4
| | | | | | | | | | | | | SLIRP -smb support wants to fork a process and forget about reaping it. To please it, add a generic service to register a process id and let QEMU reap it. In the future it could be enhanced to pass a status, but this would be unused. With this in place, the SIGCHLD signal handler would not stomp on pclose anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* change all rt_clock references to use millisecond resolution accessorsPaolo Bonzini2011-03-211-1/+1
| | | | | | | | | | | | | | | This was done with: sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \ $(git grep -l 'new_timer\>.*rt_clock' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* net: fix trace when debug is activated in slirpVincent Palatin2011-03-051-1/+1
| | | | | | | make the code compile correctly when DEBUG is activated. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Remove some type casts caused by bad declaration of x.tp_bufStefan Weil2011-02-252-8/+8
| | | | | | | | | | | | | | x.tp_buf was declared as a uint8_t array, but always used as a char array (which needed a lot of type casts). The patch includes these changes: * Fix declaration of x.tp_buf and remove all type casts. * Use offsetof() to get the offset of x.tp_buf. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix build from previous commitAnthony Liguori2011-02-141-1/+1
| | | | | | I unfortunately got on an unnamed branch and pushed the wrong bits Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* PATCH] slirp: fix buffer overrunBruce Rogers2011-02-141-2/+2
| | | | | | | | | Since the addition of the slirp member to struct mbuf, the value of SLIRP_MSIZE and the initialization of m_size have not been correct, resulting in overrunning the end of the malloc'd buffer in some cases. Signed-off-by: Bruce Rogers <brogers@novell.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Delete useless 'extern' qualifiers for functionsBlue Swirl2011-01-231-1/+1
| | | | | | | 'extern' qualifier is useless for function declarations. Delete them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Use strcasecmp() to check tftp mode, tsizeSergei Gavrikov2011-01-131-2/+2
| | | | | | | | | | | | | | According to RFC 1350 (TFTP Revision 2) the mode field can contain any combination of upper and lower case; also RFC 2349 propagates that the transfer size option ("tsize") is case in-sensitive too. Current implementation of embedded TFTP server missed that what does mess some TFTP clients. Fixed by using STRCASECMP(3) in the required places. Signed-off-by: Sergei Gavrikov <sergei.gavrikov@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
* slirp: fix unaligned access in bootp codeAurelien Jarno2011-01-101-15/+17
| | | | | | | | | | | | | | | | | | | | Slirp code tries to be smart an avoid data copy by using pointer to the data. This solution leads to unaligned access, in this case preq_addr, which is a 32-bit long structure. There is no real point of avoiding data copy in a such case, as the value itself is smaller or the same size as a pointer. The patch replaces pointers to the preq_addr structure by the strcture itself, and use the address 0.0.0.0 if no address has been requested (this is not a valid address in such a request). It compares it with htonl(0L) for correctness reasons, in case a code checker look for such mistakes. It also uses memcpy() for copying the data, which takes care of alignement issues. This fixes an unaligned access on IA64 host while requesting a DHCP address. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* slirp: Remove unused code for bad sprintfStefan Weil2010-11-213-62/+0
| | | | | | | | | | | | | Neither DECLARE_SPRINTF nor BAD_SPRINTF are needed for QEMU. QEMU won't support systems with missing or bad declarations for sprintf. The unused code was detected while looking for functions with missing format checking. Instead of adding GCC_FMT_ATTR, the unused code was removed. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Use GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-1/+1
| | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Silence warning on HaikuAndreas Färber2010-10-031-1/+3
| | | | | | | | Haiku has O_BINARY in fcntl.h. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make ARP replies at least 64 bytes longHervé Poussineau2010-09-171-1/+2
| | | | | | | | IEEE 802.3 standard requires Ethernet frames to be at least 64 bytes long. If it is not the case, they will be considered as runt frames, and may be ignored by netcard and/or OS Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Accept packets with TTL=1Hervé Poussineau2010-09-171-1/+1
| | | | | | | | Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard them This is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1 Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Change DPRINTF() to do{}while(0) to avoid compiler warningJes Sorensen2010-09-041-1/+1
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Remove declarations which are no longer neededStefan Weil2010-07-251-33/+0
| | | | | | | | | The previous patches replaced u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types from stdint.h, so we can now remove their declarations which are no longer needed. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* slirp: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int typesStefan Weil2010-07-2520-116/+110
| | | | | | | | There is no need to have a second set of integral types. Replace them by the standard types from stdint.h. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* savevm: Add DeviceState paramAlex Williamson2010-07-061-2/+3
| | | | | | | | | | When available, we'd like to be able to access the DeviceState when registering a savevm. For buses with a get_dev_path() function, this will allow us to create more unique savevm id strings. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove dead assignments in various common files, spotted by clang analyzerBlue Swirl2010-04-251-1/+0
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: fix structure initialization in tcp_listen()Juha Riihimäki2010-04-201-0/+1
| | | | | | | | | | A data structure of type sockaddr_in is allocated from stack but not properly initialized. This may lead to a failure in the bind() call later on. Fixed by filling the contents of the structure with zeroes before using it. Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: fix unused return value, spotted by clangBlue Swirl2010-04-181-1/+2
| | | | | | | | | | Fix clang errors like: CC slirp/cksum.o /src/qemu/slirp/cksum.c:78:3: error: expression result unused [-Wunused-value] REDUCE; /src/qemu/slirp/cksum.c:45:66: note: instantiated from: Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* monitor: Separate "default monitor" and "current monitor" cleanlyMarkus Armbruster2010-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits 376253ec..731b0364 introduced global variable cur_mon, which points to the "default monitor" (if any), except during execution of monitor_read() or monitor_control_read() it points to the monitor from which we're reading instead (the "current monitor"). Monitor command handlers run within monitor_read() or monitor_control_read(). Default monitor and current monitor are really separate things, and squashing them together is confusing and error-prone. For instance, usb_host_scan() can run both in "info usbhost" and periodically via usb_host_auto_check(). It prints to cur_mon, which is what we want in the former case: the monitor executing "info usbhost". But since that's the default monitor in the latter case, it periodically spams the default monitor there. A few places use cur_mon to log stuff to the default monitor. If we ever log something while cur_mon points to current monitor instead of default monitor, the log temporarily "jumps" to another monitor. Whether that can or cannot happen isn't always obvious. Maybe logging to the default monitor (which may not even exist) is a bad idea, and we should log to stderr or a logfile instead. But that's outside the scope of this commit. Change cur_mon to point to the current monitor. Create new default_mon to point to the default monitor. Update users of cur_mon accordingly. This fixes the periodical spamming of the default monitor by usb_host_scan(). It also stops "log jumping", should that problem exist.
* slirp: remove dead nested assignment, spotted by clangBlue Swirl2010-03-071-2/+1
| | | | | | | Although the value stored to 'r' is used in the enclosing expression, the value is never actually read from 'r'. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: remove dead initialization, spotted by clangBlue Swirl2010-03-071-4/+0
| | | | | | Value stored during initialization is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: remove dead increments, spotted by clangBlue Swirl2010-03-073-2/+4
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: remove dead assignments, spotted by clangBlue Swirl2010-03-072-15/+7
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* don't dereference NULL after failed strdupJim Meyering2010-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of these are obvious NULL-deref bug fixes, for example, the ones in these files: block/curl.c net.c slirp/misc.c and the first one in block/vvfat.c. The others in block/vvfat.c may not lead to an immediate segfault, but I traced the two schedule_rename(..., strdup(path)) uses, and a failed strdup would appear to trigger this assertion in handle_renames_and_mkdirs: assert(commit->path); The conversion to use qemu_strdup in envlist_to_environ is not technically needed, but does avoid a theoretical leak in the caller when strdup fails for one value, but later succeeds in allocating another buffer(plausible, if one string length is much larger than the others). The caller does not know the length of the returned list, and as such can only free pointers until it hits the first NULL. If there are non-NULL pointers beyond the first, their buffers would be leaked. This one is admittedly far-fetched. The two in linux-user/main.c are worth fixing to ensure that an OOM error is diagnosed up front, rather than letting it provoke some harder-to-diagnose secondary error, in case of exec failure, or worse, in case the exec succeeds but with an invalid list of command line options. However, considering how unlikely it is to encounter a failed strdup early in main, this isn't a big deal. Note that adding the required uses of qemu_strdup here and in envlist.c induce link failures because qemu_strdup is not currently in any library they're linked with. So for now, I've omitted those changes, as well as the fixes in target-i386/helper.c and target-sparc/helper.c. If you'd like to see the above discussion (or anything else) in the commit log, just let me know and I'll be happy to adjust. >From 9af42864fd1ea666bd25e2cecfdfae74c20aa8c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 8 Feb 2010 18:29:29 +0100 Subject: [PATCH] don't dereference NULL after failed strdup Handle failing strdup by replacing each use with qemu_strdup, so as not to dereference NULL or trigger a failing assertion. * block/curl.c (curl_open): s/\bstrdup\b/qemu_strdup/ * block/vvfat.c (init_directories): Likewise. (get_cluster_count_for_direntry, check_directory_consistency): Likewise. * net.c (parse_host_src_port): Likewise. * slirp/misc.c (fork_exec): Likewise. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Do not use dprintfmalc2010-02-071-9/+9
| | | | | | | | | dprintf is already claimed by POSIX[1], and on at least one system is implemented as a macro [1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html Signed-off-by: malc <av1474@comtv.ru>
* Qemu's internal TFTP server breaks lock-step-iness of TFTPMilan Plzik2010-01-131-0/+1
| | | | | | | | | | | | | | | According to RFC 1350 and RFC 2347, TFTP server should answer RRQ by either OACK or DATA packet. Qemu's internal TFTP server answers RRQ with additional options by sending both OACK and DATA packet, thus breaking the "lock-step" feature of the protocol, and also confuses client. Proposed solution would be to, in case of OACK packet, wait for ACK from client and just then start sending data. Attached patch implements this. Signed-off-by: Thomas Horsten <thomas@horsten.com> Signed-off-by: Milan Plzik <milan.plzik@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Handle TFTP ERROR from clientThomas Horsten2010-01-111-0/+23
| | | | | | | | | | | | | | | | | | | | | If a PXE client only wants to find out the size of a file, it will open the file and then abort the transfer by sending a TFTP ERROR packet. The ERROR packet should cause qemu to terminate the session. If not, the sessions will soon run out and cause timeouts in the client. Also, if a TFTP session already exists with same IP/UDP port, it should be terminated when a new RRQ is received, instead of creating a duplicate (which will never be used). A patch for gPXE to send the ERROR packet is also being submitted to gPXE. Together they resolve slowness/hanging when booting pxegrub from qemu's internal TFTP server. The patch from Milan Plzik to return after sending OACK is also required for a complete fix. Signed-off-by: Thomas Horsten <thomas@horsten.com> Signed-off-by: Milan Plzik <milan.plzik@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp/misc.c: fix warning with _FORTIFY_SOURCEKirill A. Shutemov2009-12-251-8/+2
| | | | | | | | | | | CC slirp/misc.o cc1: warnings being treated as errors slirp/misc.c: In function 'fork_exec': slirp/misc.c:209: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [slirp/misc.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* fix networking on win32 hostJuha Riihimäki2009-12-181-7/+7
| | | | | | | | | | At least under some mingw compilers slirp networking fails without declaring these fields packed. From: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Don't leak file descriptorsKevin Wolf2009-12-035-6/+10
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: fix use-after-freeMark McLoughlin2009-11-211-1/+1
| | | | | | | | 460fec67ee introduced a use-after free in slirp. Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* slirp: fix unmatched bracket in if 0Michael S. Tsirkin2009-09-301-2/+0
| | | | | | | Fix unmatched bracket in commented out code Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix sys-queue.h conflict for goodBlue Swirl2009-09-122-10/+10
| | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix Sparse warnings: add "static"Blue Swirl2009-09-051-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix compiler warningsStefan Weil2009-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | Starting with commit df7a86ed735eafefbd046c8cad7134652fe3f600, mingw32 builds result in a compiler warning for dns_addr: CC slirp/slirp.o /home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: missing braces around initializer /home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: (near initialization for ‘dns_addr.S_un’) Removing the assignment fixes the warning without the need of special code for mingw32 (and also saves some bytes in the resulting binary). To fix another potential compiler warning, the missing 'static' attribute was added. The same changes were applied to dns_addr_time. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* slirp: Read host DNS config on demandEd Swierk2009-08-276-14/+44
| | | | | | | | | | | | | | | | | 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>
* slirp: Remove our_addr codeEd Swierk2009-08-272-18/+0
| | | | | | | | | | | | | | | | | | | | | Three problems with our_addr: - It's determined only once when qemu starts, but the address can change (just like the DNS configuration can). - It's supposed to be the IP address of a host network interface, but there's no guarantee that gethostbyname(gethostname()) actually does that: the host might be a laptop that has only a loopback interface up, or the hostname might be localhost.localdomain, etc. - It's useless at best: get_dns_addr() calls it, there's no reason to send DNS requests to a different IP address if you're running a DNS server on the host and resolv.conf points to 127.0.0.1. These problems are easily solved by removing the code. Signed-off-by: Ed Swierk <eswierk@aristanetworks.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add missing "static"Blue Swirl2009-08-011-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud