Statistics
| Branch: | Revision:

root / slirp @ eb7faf0e

# Date Author Comment
eb7faf0e 09/13/2012 01:44 pm Jan Kiszka

slirp: Remove unused return value of tftp_send_next_block

No caller actually makes use of this value, so let's simplify the code.

Signed-off-by: Jan Kiszka <>

4aa401f3 09/13/2012 01:39 pm Hervé Poussineau

slirp: Handle more than 65535 blocks in TFTP transfers

RFC 1350 does not mention block count roll-over. However, a lot of TFTP servers
implement it to be able to transmit big files, so do it also.

Current block size is 512 bytes, so TFTP files were limited to 32 MB....

c4d12a74 09/13/2012 01:38 pm Stefan Weil

slirp: Remove wrong type casts ins debug statements

The type casts of pointers to long are not allowed
when sizeof(pointer) != sizeof(long).

Signed-off-by: Stefan Weil <>
Signed-off-by: Jan Kiszka <>

e56afbc5 09/13/2012 01:38 pm Stefan Weil

slirp: Fix error reported by static code analysis

Report from smatch:

slirp/tcp_subr.c:127 tcp_respond(17) error:
we previously assumed 'tp' could be null (see line 124)

Return if 'tp' is NULL.

Signed-off-by: Stefan Weil <>
Signed-off-by: Jan Kiszka <>

78be0566 09/13/2012 01:38 pm Hervé Poussineau

slirp: improve TFTP performance

When transferring a file, keep it open during the whole transfer,
instead of opening/closing it for each block.

Signed-off-by: Hervé Poussineau <>
Reviewed-by: Aurelien Jarno <>
Signed-off-by: Jan Kiszka <>

0b8db8fe 08/07/2012 03:31 am Anthony Liguori

slirp: fix build on mingw32

in_addr_t isn't available on mingw32. Just use an unsigned long instead. I
considered typedef'ing in_addr_t on mingw32 but this would potentially be
brittle if mingw32 did introduce the type.

Cc: Jan Kiszka <>...

648cd33e 08/04/2012 12:31 am Anders Waldenborg

slirp: Handle whole 127.0.0.0/8 network as local addresses.

Changes so translation of remote address to the host's ip address in
the virtual network happens for all addresses in the 127.0.0.0/8
network, not just 127.0.0.1.

This fixes so that hostfwd bound to addresses such as 127.0.0.2 works....

691a4f3a 08/01/2012 03:32 pm Zhi Yong Wu

net: determine if packets can be sent before net queue deliver packets

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Laszlo Ersek <>

4c696054 06/07/2012 10:21 am Paolo Bonzini

build: move slirp/ objects to nested Makefile.objs

Signed-off-by: Paolo Bonzini <>

917cfc1f 05/28/2012 11:44 pm Andreas Färber

slirp: Avoid redefining MAX_TCPOPTLEN

MAX_TCPOPTLEN is being defined as 32. Darwin already has it as 40,
causing a warning. The value is only used to declare an array,
into which currently 4 bytes are written at most.

Therefore always override MAX_TCPOPTLEN for now....

9b24d8e9 05/28/2012 11:31 pm Andreas Färber

slirp: Avoid statements without effect on Big Endian host

Darwin has HTON*/NTOH* macros that on BE simply return the argument.
This is incompatible with SLIRP's use of these macros as a statement.

Undefine the macros in the HOST_WORDS_BIGENDIAN code path to redefine...

e20e48a8 05/28/2012 02:45 pm Andreas Färber

slirp: Untangle TCPOLEN_* from TCPOPT_*

Commit b72210568ef0c0fb141a01cffb71a09c4efa0364 (slirp: clean up
conflicts with system headers) enclosed TCPOLEN_MAXSEG with an #ifdef
TCPOPT_EOL. This broke the build on illumos, which has TCPOPT_*
but not TCPOLEN_*....

7c7db755 04/26/2012 09:14 pm Stefano Stabellini

main_loop_wait: block indefinitely

- remove qemu_calculate_timeout;

- explicitly size timeout to uint32_t;

- introduce slirp_update_timeout;

- pass NULL as timeout argument to select in case timeout is the maximum
value;

Signed-off-by: Stefano Stabellini <>...

acf126ba 04/15/2012 10:25 pm Stefan Weil

w32: Move defines for socket specific errors to qemu-os-win32.h

As those defines are only used for w32,
they should be in the header file for w32.

All files which include slirp.h or qemu_socket.h also
include qemu-os-win32.h.

Signed-off-by: Stefan Weil <>

86073017 03/30/2012 08:43 pm Jan Kiszka

slirp: Signal free input buffer space to io-thread

This massively accelerates slirp reception speed: If data arrives
faster than the guest can read it from the input buffer, the file
descriptor for the corresponding socket was taken out of the fdset for
select. However, the event of the guest reading enough data from the...

56688961 03/28/2012 10:03 pm Jan Kiszka

w32/slirp: Undefine error constants before their redefinition

Less warnings for your console.

Signed-off-by: Jan Kiszka <>

1c5970a8 03/28/2012 09:33 pm Paolo Bonzini

slirp: use socket_set_nonblock

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Jan Kiszka <>

b7221056 03/28/2012 09:33 pm Paolo Bonzini

slirp: clean up conflicts with system headers

Right now, slirp/slirp.h cannot include some system headers and,
indirectly, qemu_socket.h. Clean this up, and remove a duplicate
prototype that was introduced because of that.

Signed-off-by: Paolo Bonzini <>...

2d26512b 03/13/2012 05:15 pm Stefan Weil

slirp: Fix compiler warning for w64

Casting a pointer to an integer value must use uintptr_t or intptr_t
(not long) for portable code. MinGW-w64 requires this because
sizeof(long) != sizeof(void *) for w64 hosts, so casting to long
raises a compiler warning....

f3734319 03/13/2012 03:05 pm Jan Kiszka

slirp: Remove unneeded if_queued

There is now a trivial check on entry of if_start for pending packets,
so we can drop the additional tracking via if_queued.

Signed-off-by: Jan Kiszka <>

a68adc22 03/13/2012 03:05 pm Jan Kiszka

slirp: Cleanup resources on instance removal

Close & free sockets when shutting down a slirp instance, also release
all buffers.

CC: Michael S. Tsirkin <>
Signed-off-by: Jan Kiszka <>

d6536b2c 03/13/2012 03:05 pm Jan Kiszka

slirp: Keep next_m always valid

Make sure that next_m always points to a packet if batchq is non-empty.
This will simplify walking the queues in if_start.

CC: Fabien Chouteau <>
CC: Zhi Yong Wu <>
CC: Stefan Weil <>...

953e7f54 03/13/2012 03:05 pm Jan Kiszka

slirp: Prevent recursion of if_start

if_start can be called recursively via if_encap. Avoid this as our
scheme of dequeuing packets is not compatible with this.

CC: Fabien Chouteau <>
CC: Zhi Yong Wu <>
CC: Stefan Weil <>...

e3078bf4 03/13/2012 03:05 pm Jan Kiszka

slirp: Fix queue walking in if_start

Another attempt to get this right: We need to carefully walk both the
fastq and the batchq in if_start while trying to send packets to
possibly not yet resolved hosts on the virtual network.

So far we just requeued a delayed packet where it was and then started...

90d7416a 02/27/2012 03:55 pm David Gibson

slirp: Fix assertion failure on rejected DHCP requests

The guest network stack might DHCPREQUEST an address that the slirp built
in dhcp server can't let it have - for example if the guest has an old
leases file from another network configuration. In this case the dhcp...

79e7e937 02/27/2012 03:54 pm Jan Kiszka

slirp: Clean up ifs_init

Remove duplicate ifs_init macros, reimplement the logic as static inline
in mbuf.h.

CC: Zhi Yong Wu <>
CC: Michael S. Tsirkin <>
Signed-off-by: Jan Kiszka <>

b248ede2 02/27/2012 03:54 pm Jan Kiszka

slirp: Fix requeuing of batchq packets in if_start

In case we requeued a packet that was the head of a longer session
queue, we failed to restore this ordering. Also, we did not properly
deal with changes to Slirp::next_m.

Instead of a cumbersome roll back, this fix simply avoids any changes...

b87ffa16 02/27/2012 03:54 pm Jan Kiszka

slirp: Refactor if_start

Replace gotos with a while loop, fix coding style.

CC: Zhi Yong Wu <>
CC: Fabien Chouteau <>
Signed-off-by: Jan Kiszka <>

f293d8b1 02/24/2012 03:24 pm Alon Levy

slirp/misc: fix gcc __warn_memset_zero_len warnings

By removing memset altogether (Patch from Stefan Hajnoczi, tested
compile only by me).

Signed-off-by: Alon Levy <>
Signed-off-by: Stefan Hajnoczi <>

9f1134d4 02/08/2012 11:07 am Stefan Weil

slirp: Remove unused variable and unused code

9634d9031c140b24c7ca0d8872632207f6ce7275 disabled unused code.
This patch removes what was left.

If do_pty is 2, the function returns immediately, so any later checks
for do_pty == 2 will always fail and can be removed together with...

6612db12 02/08/2012 11:07 am Jan Kiszka

slirp: Prevent sending ICMP error replies to source-only addresses

This triggered the related assert in arp_table_search.

Signed-off-by: Jan Kiszka <>

d3b12f5d 10/21/2011 07:14 pm Paolo Bonzini

main-loop: create main-loop.c

Signed-off-by: Paolo Bonzini <>

2b440432 09/28/2011 02:11 pm Thomas Huth

slirp: Fix packet expiration

The two new variables "arp_requested" and "expiration_date" in the mbuf
structure have been added after the variable-sized "m_dat_" array. The
variables have to be added before the m_dat_ array instead.
Without this patch, the expiration_date gets clobbered by code that...

8d06d69b 09/28/2011 02:10 pm Jan Kiszka

slirp: Fix use after release on tcp_input

ti points into the m buffer. But the latter may already be released
right after the dodata: label. Move the test before the potential
release.

Signed-off-by: Jan Kiszka <>

39ba59c2 09/20/2011 11:18 pm Anthony Liguori

Merge remote-tracking branch 'kiszka/queues/slirp' into staging

b2bedb21 09/16/2011 04:25 pm Stefan Weil

Remove blanks before \n in output strings

Those blanks violate the coding conventions, see
scripts/checkpatch.pl.

Blanks missing after colons in the changed lines were added.

This patch does not try to fix tabs, long lines and other
problems in the changed lines, therefore checkpatch.pl reports...

144d192d 09/16/2011 01:16 am Jan Kiszka

slirp: Fill TCP/IP header template after SYN reception

This ensures we can cleanly signal the drop in case the connection timer
fires. So far we sent those frames to nowhere (target IP 0.0.0.0).

Found by the new assertion on invalid IPs in arp_table_search....

5a61cb60 09/09/2011 11:56 am Stefan Weil

Fix include statements for qemu-common.h

  • qemu-common.h is not a system include file, so it should be included
    with "" instead of <>. Otherwise incremental builds might fail
    because only local include files are checked for changes.
  • linux-user/syscall.c included the file twice....
541dc0d4 09/03/2011 01:45 pm Stefan Weil

Use new macro QEMU_PACKED for packed structures

Most changes were made using these commands:

git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'...

2cc6e0a1 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_write() -> qemu_chr_fe_write()

Signed-off-by: Anthony Liguori <>

aec7c6dc 08/21/2011 10:19 pm Blue Swirl

Merge branch 'queues/slirp' of git://git.kiszka.org/qemu

  • 'queues/slirp' of git://git.kiszka.org/qemu:
    slirp: Fix bit field types in IP header structs
7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

1b930bfa 08/15/2011 09:34 am Jan Kiszka

slirp: Fix bit field types in IP header structs

-mms-bitfields prevents that the bitfields in current IP header structs
are packed into a single byte as it is required. Fix this by using
uint8_t as backing type.

Signed-off-by: Jan Kiszka <>

e3a110b5 08/05/2011 03:05 pm Jan Kiszka

slirp: Only start packet expiration for delayed ones

The expiration timeout must only affect packets that are queued due to
pending ARP resolutions. The old version broke ping e.g.

Signed-off-by: Jan Kiszka <>

fd593879 08/05/2011 03:04 pm Jan Kiszka

slirp: Read current time only once per if_start call

No need to update the current time for each packet we send from the
queue. Processing time is comparably short.

Signed-off-by: Jan Kiszka <>

5a371a2e 08/05/2011 01:51 pm Jan Kiszka

slirp: Fix types of IP address parameters

Should be uint32_t for IPv4, not int. Also avoid in_addr_t without
proper includes. Fixes build regression on mingw32.

Signed-off-by: Jan Kiszka <>

1ab74cea 08/03/2011 01:57 pm Fabien Chouteau

Delayed IP packets

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...

1a0ca1e1 08/03/2011 01:57 pm Fabien Chouteau

Simple ARP table

This patch adds a simple ARP table in Slirp and also adds handling of
gratuitous ARP requests.

Signed-off-by: Fabien Chouteau <>
Signed-off-by: Jan Kiszka <>

cf2846b5 07/27/2011 12:10 pm Stefan Weil

slirp: Fix unusual "comments" in unused code

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)....

00aa0040 07/25/2011 05:38 pm Blue Swirl

Wrap recv to avoid warnings

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]...

e6d43cfb 07/23/2011 06:19 pm Jan Kiszka

slirp: Forward ICMP echo requests via unprivileged sockets

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...

12b513d8 07/23/2011 06:19 pm Jan Kiszka

slirp: Fix restricted mode

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....

5a82362a 07/23/2011 06:19 pm Jan Kiszka

slirp: Strictly associate DHCP/BOOTP and TFTP with virtual host

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 <>
Signed-off-by: Anthony Liguori <>

3acccfc6 07/23/2011 06:19 pm Jan Kiszka

slirp: Replace m_freem with m_free

Remove this pointless wrapping.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

565465fc 07/23/2011 06:19 pm Jan Kiszka

slirp: Put forked exec into separate process group

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...

4d54ec78 03/29/2011 04:14 pm Paolo Bonzini

add a service to reap zombies, use it in SLIRP

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,...

7bd427d8 03/21/2011 10:23 am Paolo Bonzini

change all rt_clock references to use millisecond resolution accessors

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/' \...
24ac3a7d 03/05/2011 02:00 pm Vincent Palatin

net: fix trace when debug is activated in slirp

make the code compile correctly when DEBUG is activated.

Signed-off-by: Vincent Palatin <>
Signed-off-by: Blue Swirl <>

89d2d3af 02/25/2011 05:58 pm Stefan Weil

slirp: Remove some type casts caused by bad declaration of x.tp_buf

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....
8fe3046f 02/14/2011 10:24 pm Anthony Liguori

Fix build from previous commit

I unfortunately got on an unnamed branch and pushed the wrong bits

Signed-off-by: Anthony Liguori <>

53fae6d2 02/14/2011 09:23 pm Bruce Rogers

PATCH] slirp: fix buffer overrun

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 <>...

64b85a8f 01/23/2011 06:21 pm Blue Swirl

Delete useless 'extern' qualifiers for functions

'extern' qualifier is useless for function declarations. Delete
them.

Signed-off-by: Blue Swirl <>

facf1a60 01/13/2011 12:38 pm Sergei Gavrikov

slirp: Use strcasecmp() to check tftp mode, tsize

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...

8aaf42ed 01/10/2011 11:56 am Aurelien Jarno

slirp: fix unaligned access in bootp code

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...

9eca6cc6 11/21/2010 05:16 pm Stefan Weil

slirp: Remove unused code for bad sprintf

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...

8b7968f7 10/03/2010 09:34 am Stefan Weil

Use GCC_FMT_ATTR (format checking)

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

4a2b39d3 10/03/2010 09:31 am Andreas Färber

slirp: Silence warning on Haiku

Haiku has O_BINARY in fcntl.h.

Signed-off-by: Andreas Färber <>
Cc: Jan Kiszka <>
Signed-off-by: Blue Swirl <>

0d491754 09/17/2010 01:46 pm Hervé Poussineau

Accept packets with TTL=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 <>...

dbf3c4b4 09/17/2010 01:46 pm Hervé Poussineau

Make ARP replies at least 64 bytes long

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 <>...

7390cdfb 09/04/2010 12:45 pm Jes Sorensen

Change DPRINTF to do{}while(0) to avoid compiler warning

Signed-off-by: Jes Sorensen <>
Signed-off-by: Blue Swirl <>

b6dce92e 07/25/2010 05:59 pm Stefan Weil

slirp: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types

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 <>
Signed-off-by: Aurelien Jarno <>

08dc07a3 07/25/2010 05:59 pm Stefan Weil

slirp: Remove declarations which are no longer needed

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 <>...

0be71e32 07/06/2010 06:36 pm Alex Williamson

savevm: Add DeviceState param

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 <>...

9678d950 04/25/2010 09:35 pm Blue Swirl

Remove dead assignments in various common files, spotted by clang analyzer

Value stored is never read.

Signed-off-by: Blue Swirl <>

ab07b980 04/20/2010 07:42 pm Juha Riihimäki

slirp: fix structure initialization in tcp_listen()

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...

7107944a 04/18/2010 05:27 pm Blue Swirl

slirp: fix unused return value, spotted by clang

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 <>

8631b608 03/16/2010 05:55 pm Markus Armbruster

monitor: Separate "default monitor" and "current monitor" cleanly

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...

7071ff32 03/07/2010 03:45 pm Blue Swirl

slirp: remove dead initialization, spotted by clang

Value stored during initialization is never read.

Signed-off-by: Blue Swirl <>

b0e04867 03/07/2010 03:45 pm Blue Swirl

slirp: remove dead nested assignment, spotted by clang

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 <>

369c86e7 03/07/2010 03:45 pm Blue Swirl

slirp: remove dead increments, spotted by clang

Value stored is never read.

Signed-off-by: Blue Swirl <>

aca9fcd2 03/07/2010 03:13 pm Blue Swirl

slirp: remove dead assignments, spotted by clang

Value stored is never read.

Signed-off-by: Blue Swirl <>

6265eb26 02/10/2010 10:00 pm Jim Meyering

don't dereference NULL after failed strdup

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...

d0f2c4c6 02/07/2010 01:03 am malc

Do not use dprintf

dprintf is already claimed by POSIX1, 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 <>

1cb1a66a 01/14/2010 01:14 am Milan Plzik

Qemu's internal TFTP server breaks lock-step-iness of TFTP

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...

bfe4e172 01/11/2010 09:41 pm Thomas Horsten

Handle TFTP ERROR from client

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....

f0d98b05 12/25/2009 08:19 pm Kirill A. Shutemov

slirp/misc.c: fix warning with _FORTIFY_SOURCE

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...
9a0c6a33 12/19/2009 12:23 am Juha Riihimäki

fix networking on win32 host

At least under some mingw compilers slirp networking fails without declaring
these fields packed.

From: Juha Riihimäki <>
Signed-off-by: Juha Riihimäki <>
Signed-off-by: Riku Voipio <>...

40ff6d7e 12/03/2009 07:45 pm Kevin Wolf

Don't leak file descriptors

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 <>
Signed-off-by: Anthony Liguori <>

e0cf6d15 11/21/2009 01:34 am Mark McLoughlin

slirp: fix use-after-free

460fec67ee introduced a use-after free in slirp.

Cc: Jan Kiszka <>
Signed-off-by: Mark McLoughlin <>
Signed-off-by: Aurelien Jarno <>

65528b19 09/30/2009 09:56 pm Michael S. Tsirkin

slirp: fix unmatched bracket in if 0

Fix unmatched bracket in commented out code

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Blue Swirl <>

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

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,...

1e6eec8b 09/05/2009 01:14 pm Blue Swirl

Fix Sparse warnings: add "static"

Signed-off-by: Blue Swirl <>

9e3a95ef 08/31/2009 06:41 pm Stefan Weil

Fix compiler warnings

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...
ce0bd027 08/28/2009 04:46 am Ed Swierk

slirp: Remove our_addr code

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...

df7a86ed 08/28/2009 04:46 am Ed Swierk

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...

23534222 08/01/2009 01:13 pm Blue Swirl

Add missing "static"

Signed-off-by: Blue Swirl <>

7cba04f6 08/01/2009 01:13 pm Blue Swirl

More NULL pointer fixes

Signed-off-by: Blue Swirl <>

e2542fe2 07/27/2009 10:09 pm Juan Quintela

rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

97df1ee5 07/27/2009 10:09 pm Ed Swierk

slirp: Remove UDP protocol emulation (talk, cuseeme)

The UDP emulation code for talk has been commented out since the
beginning of time, and unless someone who runs CU-SeeMe on qemu with
user-mode networking can vouch that the special magic (a) is necessary...

aaf10d9d 07/27/2009 10:09 pm Ed Swierk

slirp: Use monotonic clock if available (v2)

Calling gettimeofday() to compute a time interval can cause problems if
the system clock jumps forwards or backwards; replace updtime() with
qemu_get_clock(rt_clock), which calls clock_gettime(CLOCK_MONOTONIC) if...