Statistics
| Branch: | Revision:

root / slirp / slirp.c @ 7bd427d8

History | View | Annotate | Download (30.6 kB)

# Date Author Comment
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/' \...
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 <>...

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

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

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

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

bb53fc53 07/27/2009 10:08 pm Jan Kiszka

slirp: Fix guestfwd for incoming data

Unless a virtual server address was explicitly defined (which is
impossible with the legacy net channel format), guestfwd did not
properly forwarded host
>guest packets. This patch fixes it.

Signed-off-by: Jan Kiszka <>...

b1c99fcd 06/29/2009 04:52 pm Jan Kiszka

slirp: Enable multiple instances

Once again this was a long journey to reach the destination: Allow to
instantiate slirp multiple times. But as in the past, the journey was
worthwhile, cleaning up, fixing and enhancing various parts of the user
space network stack along the way....

0a1f851e 06/29/2009 04:52 pm Jan Kiszka

slirp: Save/restore bootp client states

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

8ec7f4ed 06/29/2009 04:52 pm Jan Kiszka

slirp: Clean up updtime

Drop redundant typecasts in both variants and remove the pointless
round-up in the UNIX version.

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

d918f23e 06/29/2009 04:52 pm Jan Kiszka

slirp: Kill slirp_is_inited

Avoid the need for slirp_is_inited by refactoring the protected
slirp_select_* functions. This also avoids the clearing of all fd sets
on select errors.

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

f1d99bbd 06/29/2009 04:52 pm Jan Kiszka

slirp: Clean up timeout handling around slirp_select_fill/poll

Again lot of dead code. Remove it.

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

b5302e1a 06/29/2009 04:52 pm Jan Kiszka

slirp: Drop link_up checks from if_output and slirp_socket_can_recv

link_up is true once slirp is initialized, so these check are really not
required.

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

460fec67 06/29/2009 04:52 pm Jan Kiszka

slirp: Factor out internal state structure

The essence of this patch is to stuff (almost) all global variables of
the slirp stack into the structure Slirp. In this step, we still keep
the structure as global variable, directly accessible by the whole
stack. Changes to the external interface of slirp will be applied in...

9f8bd042 06/29/2009 04:52 pm Jan Kiszka

slirp: Use internal state in interface

This now also exports the internal state to the slirp users in qemu,
returning it from slirp_init and expecting it along with service
invocations. Additionally provide an opaque value interface for the
callbacks from slirp into the qemu core....

ad0d8c4c 06/29/2009 04:52 pm Jan Kiszka

slirp: Allocate/free stack instance dynamically

Allocate the internal slirp state dynamically and provide and call
slirp_cleanup to properly release it after use. This patch finally
unbreaks slirp release and re-instantiation via host_net_* monitor
commands....

285f7a62 06/29/2009 04:52 pm Jan Kiszka

slirp: Make IP packet ID consistent

Currently, ip_id is always initialized to 0 on slirp startup (despite
the broken attempt to derive it from the clock). This is good for
reproducibility. But it is not preserved across save/restore. This patch
therefore drops the dead initialization code from ip_init and introduces...

df461894 06/29/2009 04:52 pm Jan Kiszka

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

9c12a6f2 06/29/2009 04:52 pm Jan Kiszka

slirp: Do not allow to remove non-hostfwd sockets

Prevent that the users accidentally shoots down dynamic sockets. This
allows to remove looping for removals as there can now only be one
match.

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

0d62c4cf 06/29/2009 04:52 pm Jan Kiszka

slirp: Drop dead code

After all its years inside the qemu tree, there is no point in keeping
the dead code paths of slirp. This patch is a first round of removing
usually commented out code parts. More cleanups need to follow (and
maybe finally a proper reindention)....

a13a4126 06/29/2009 04:52 pm Jan Kiszka

slirp: Rework internal configuration

The user mode IP stack is currently only minimally configurable /wrt to
its virtual IP addresses. This is unfortunate if some guest has a fixed
idea of which IP addresses to use.

Therefore this patch prepares the stack for fully configurable IP...

c92ef6a2 06/29/2009 04:52 pm Jan Kiszka

slirp: Rework external configuration interface

With the internal IP configuration made more flexible, we can now
enhance the user interface. This patch adds a number of new options to
"-net user": net (address and mask), host, dhcpstart, dns and smbserver....

2ad82cf9 06/29/2009 04:52 pm Jan Kiszka

slirp: Fix port comparision in slirp_remove_hostfwd

For UDP host forwardings, fport is not stable, every outgoing packet of
the redirection can modify it. Use getsockname instead to look up the
port that is actually used on the host side.

Signed-off-by: Jan Kiszka <>...

3c6a0580 06/29/2009 04:52 pm Jan Kiszka

slirp: Bind support for host forwarding rules

Extend the hostfwd rule format so that the user can specify on which
host interface qemu should listen for incoming connections. If omitted,
binding will takes place against all interfaces.

Signed-off-by: Jan Kiszka <>...

f932b6ce 06/29/2009 04:52 pm Jan Kiszka

slirp: Prepare for persistent socket state flags

This prepares for adding flags to socket.so_state that must not be
removed during the lifetime of a socket.

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

6dd5ffb6 06/29/2009 04:52 pm Jan Kiszka

slirp: Explicitely mark host-forwarding sockets

Mark sockets that describe host forwardings. This is required for their
(and only their) proper deletion and for pretty-printing.

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

e15f4a99 06/29/2009 04:52 pm Jan Kiszka

Revert "User networking: Show active connections"

This reverts commit 1c6ed9f3379faac83da0ed3e95cbd49003ac0dd1.

It's redundant to slirp statistics, which are going to be split up /
reworked later on.

Conflicts:

monitor.c
net.c

Signed-off-by: Jan Kiszka <>...

ad196a9d 06/29/2009 04:52 pm Jan Kiszka

slirp: Move smb, redir, tftp and bootp parameters and -net channel

So far a couple of slirp-related parameters were expressed via
stand-alone command line options. This it inconsistent and unintuitive.
Moreover, it prevents both dynamically reconfigured (host_net_add/...

b8e8af38 06/09/2009 01:38 pm Jan Kiszka

slirp: Reorder initialization

This patch reorders the initialization of slirp itself as well as its
associated features smb and redirection. So far the first reference to
slirp triggered the initialization, independent of the actual -net user
option which may carry additional parameters. Now we save any request to...

1c6ed9f3 05/28/2009 10:14 am Alexander Graf

User networking: Show active connections

In case you're wondering what connections exactly you have open
or maybe redir'ed in the past, you can't really find out from qemu
right now.

This patch enables you to see all current connections the host
only networking holds open, so you can kill them using the previous...

c1261d8d 05/27/2009 05:46 pm Alexander Graf

User Networking: Enable removal of redirections

Using the new host_net_redir command you can easily create redirections
on the fly while your VM is running.

While that's great, it's missing the removal of redirections, in case you
want to have a port closed again at a later point in time....

0a656f5f 05/21/2009 04:30 am malc

Cast pointer arguments of get/setsockopt, send to void * to keep GCC
from producing a warning about pointer type mismatches with Winsock

Signed-off-by: malc <>

511d2b14 03/07/2009 05:32 pm blueswir1

Sparse fixes: NULL use, header order, ANSI prototypes, static

Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162

429d0a3d 01/13/2009 09:48 pm blueswir1

Fix 64 bit issue in slirp

Signed-off-by: Gleb Natapov <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6288 c046a42c-6fe2-441c-8c8c-71466251a162

0580ac91 01/12/2009 07:51 pm blueswir1

Fix some SLIRP warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6272 c046a42c-6fe2-441c-8c8c-71466251a162

062e5527 01/08/2009 09:27 pm aliguori

Add support for vmchannel socket migration (Gleb Natapov)

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6243 c046a42c-6fe2-441c-8c8c-71466251a162

a9ba3a85 01/08/2009 09:24 pm aliguori

Add slirp_restrict option (Gleb Natapov)

Add "slirp firewall" to permit connection only to vmchannel addresses.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6241 c046a42c-6fe2-441c-8c8c-71466251a162

e1c5a2b3 01/08/2009 09:18 pm aliguori

Redirect slirp traffic to/from qemu character device (Gleb Natapov)

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6240 c046a42c-6fe2-441c-8c8c-71466251a162

e8e880a7 12/07/2008 08:15 pm aurel32

slirp: fix CVE 2007-5729

The emulated network cards in QEMU allows local users to execute arbitrary
code by writing Ethernet frames with a size larger than the slirp's default
MTU, which triggers a heap-based buffer overflow in the slirp library.

Signed-off-by: Aurelien Jarno <>...

d75a0b97 10/17/2008 08:31 pm bellard

added explicit license

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5499 c046a42c-6fe2-441c-8c8c-71466251a162

de806f07 10/17/2008 08:28 pm bellard

allow SLIRP to make an ARP request to get the client MAC address. It is useful if an inbound connection is done to a VM which did not send outbound IP packets

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5498 c046a42c-6fe2-441c-8c8c-71466251a162

363a37d5 08/21/2008 08:58 pm blueswir1

Fix OpenBSD linker warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162

8fcd3692 08/17/2008 11:26 pm blueswir1

Fix some warnings that would be generated by gcc -Wmissing-prototypes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5022 c046a42c-6fe2-441c-8c8c-71466251a162

9634d903 10/26/2007 10:01 pm blueswir1

Use const and static as needed, disable unused code

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3452 c046a42c-6fe2-441c-8c8c-71466251a162

31a60e22 10/26/2007 09:42 pm blueswir1

Make Slirp statistics gathering and output conditional to LOG_ENABLED
Add 'info slirp' command to monitor to display statistics
Disable Slirp debugging code by default

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3451 c046a42c-6fe2-441c-8c8c-71466251a162

3b46e624 09/17/2007 11:09 am ths

find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162

5fafdf24 09/17/2007 12:08 am ths

find -type f | xargs sed -i 's/[\t ]$//g' # on most files

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162

38f3e7c2 05/10/2006 10:21 pm bellard

suppressed unaligned accesses

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1911 c046a42c-6fe2-441c-8c8c-71466251a162

8dbca8dd 05/03/2006 10:58 pm bellard

separate alias_addr (10.0.2.2) from our_addr (Ed Swierk)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1895 c046a42c-6fe2-441c-8c8c-71466251a162

3f423c9c 05/01/2006 12:34 am bellard

removed warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1871 c046a42c-6fe2-441c-8c8c-71466251a162

f4e15b4b 04/23/2006 10:41 pm pbrook

Fix slirp redirection on systems without a useful host IP address.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1837 c046a42c-6fe2-441c-8c8c-71466251a162

0f8134bf 04/16/2006 04:02 pm pbrook

Downgrade DNS failure to a warning.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1815 c046a42c-6fe2-441c-8c8c-71466251a162

115defd1 04/16/2006 02:06 pm pbrook

Set slirp client hostname.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1813 c046a42c-6fe2-441c-8c8c-71466251a162

df5f8956 09/03/2005 01:45 pm bellard

improved user net performances

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1561 c046a42c-6fe2-441c-8c8c-71466251a162

02d2c54c 10/08/2004 02:27 am bellard

windows fixes (Gregory Alexander)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1102 c046a42c-6fe2-441c-8c8c-71466251a162

a3d4af03 09/06/2004 02:10 am bellard

allow inetd like program exec

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1060 c046a42c-6fe2-441c-8c8c-71466251a162

9bf05444 08/26/2004 01:12 am bellard

port redirection support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1054 c046a42c-6fe2-441c-8c8c-71466251a162

379ff53d 07/13/2004 01:33 am bellard

win32 compile

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1016 c046a42c-6fe2-441c-8c8c-71466251a162

1d43a717 07/06/2004 12:18 am bellard

forgot fclose()

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@979 c046a42c-6fe2-441c-8c8c-71466251a162

512176db 05/04/2004 06:14 am bellard

fixed dhcp for windows client

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@784 c046a42c-6fe2-441c-8c8c-71466251a162

f0cbd3ec 04/22/2004 03:10 am bellard

initial user mode network support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@733 c046a42c-6fe2-441c-8c8c-71466251a162