diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-06-24 14:42:30 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 08:52:47 -0500 |
commit | df46189412567906312684eb72ba87c6a86a4cdb (patch) | |
tree | dc1b8f320294afc70b2984e47ebb5b64f5f22baf /slirp/misc.c | |
parent | 9367964ae21d2a41517c76c87dd26c79abcfe937 (diff) |
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 'slirp/misc.c')
-rw-r--r-- | slirp/misc.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/slirp/misc.c b/slirp/misc.c index ae6f211490..cffb3a0dac 100644 --- a/slirp/misc.c +++ b/slirp/misc.c @@ -16,23 +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; |