aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-06-24 14:42:30 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 08:52:47 -0500
commit8fb8cb1b6c3ab78e454a4cce5ba3a630be7dc7d6 (patch)
tree51a8ff17485b5637e3addd3745ff3d124837a2de /misc.c
parentf1e53121bfc9135023567ac5a35a7795526aa27c (diff)
downloadslirp-8fb8cb1b6c3ab78e454a4cce5ba3a630be7dc7d6.zip
slirp-8fb8cb1b6c3ab78e454a4cce5ba3a630be7dc7d6.tar.gz
slirp-8fb8cb1b6c3ab78e454a4cce5ba3a630be7dc7d6.tar.bz2
slirp: Factor out one-time initialization
In order to prepare re-initialization and multi-instance slirp, factor out init code that is of global scope and (at least for now) only need to be run once. This also fixes the potentially uninitialized use of our_addr in get_dns_addr. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/misc.c b/misc.c
index 48b60ee..a7722ef 100644
--- a/misc.c
+++ b/misc.c
@@ -16,22 +16,6 @@ int slirp_debug = DBG_CALL | DBG_MISC | DBG_ERROR;
u_int curtime, time_fasttimo, last_slowtimo;
-/*
- * Get our IP address and put it in our_addr
- */
-void getouraddr(void)
-{
- char buff[256];
- struct hostent *he = NULL;
-
- if (gethostname(buff, 256) == 0)
- he = gethostbyname(buff);
- if (he)
- our_addr = *(struct in_addr *)he->h_addr;
- if (our_addr.s_addr == 0)
- our_addr.s_addr = loopback_addr.s_addr;
-}
-
struct quehead {
struct quehead *qh_link;
struct quehead *qh_rlink;