History | View | Annotate | Download (30.5 kB)
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
Fix Sparse warnings: add "static"
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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...
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, butthere's no guarantee that gethostbyname(gethostname()) actually does...
slirp: Read host DNS config on demand
Currently the qemu user-mode networking stack reads the host DNSconfiguration (/etc/resolv.conf or the Windows equivalent) only oncewhen qemu starts. This causes name lookups in the guest to fail if thehost is moved to a different network from which the original DNS servers...
Add missing "static"
slirp: Use monotonic clock if available (v2)
Calling gettimeofday() to compute a time interval can cause problems ifthe system clock jumps forwards or backwards; replace updtime() withqemu_get_clock(rt_clock), which calls clock_gettime(CLOCK_MONOTONIC) if...
slirp: Fix guestfwd for incoming data
Unless a virtual server address was explicitly defined (which isimpossible with the legacy net channel format), guestfwd did notproperly forwarded host>guest packets. This patch fixes it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
slirp: Enable multiple instances
Once again this was a long journey to reach the destination: Allow toinstantiate slirp multiple times. But as in the past, the journey wasworthwhile, cleaning up, fixing and enhancing various parts of the userspace network stack along the way....
slirp: Save/restore bootp client states
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
slirp: Clean up updtime
Drop redundant typecasts in both variants and remove the pointlessround-up in the UNIX version.
slirp: Kill slirp_is_inited
Avoid the need for slirp_is_inited by refactoring the protectedslirp_select_* functions. This also avoids the clearing of all fd setson select errors.
slirp: Clean up timeout handling around slirp_select_fill/poll
Again lot of dead code. Remove it.
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 notrequired.
slirp: Factor out internal state structure
The essence of this patch is to stuff (almost) all global variables ofthe slirp stack into the structure Slirp. In this step, we still keepthe structure as global variable, directly accessible by the wholestack. Changes to the external interface of slirp will be applied in...
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 serviceinvocations. Additionally provide an opaque value interface for thecallbacks from slirp into the qemu core....
slirp: Allocate/free stack instance dynamically
Allocate the internal slirp state dynamically and provide and callslirp_cleanup to properly release it after use. This patch finallyunbreaks slirp release and re-instantiation via host_net_* monitorcommands....
slirp: Make IP packet ID consistent
Currently, ip_id is always initialized to 0 on slirp startup (despitethe broken attempt to derive it from the clock). This is good forreproducibility. But it is not preserved across save/restore. This patchtherefore drops the dead initialization code from ip_init and introduces...
slirp: Factor out one-time initialization
In order to prepare re-initialization and multi-instance slirp, factorout init code that is of global scope and (at least for now) only needto be run once.
This also fixes the potentially uninitialized use of our_addr in...
slirp: Do not allow to remove non-hostfwd sockets
Prevent that the users accidentally shoots down dynamic sockets. Thisallows to remove looping for removals as there can now only be onematch.
slirp: Drop dead code
After all its years inside the qemu tree, there is no point in keepingthe dead code paths of slirp. This patch is a first round of removingusually commented out code parts. More cleanups need to follow (andmaybe finally a proper reindention)....
slirp: Rework internal configuration
The user mode IP stack is currently only minimally configurable /wrt toits virtual IP addresses. This is unfortunate if some guest has a fixedidea of which IP addresses to use.
Therefore this patch prepares the stack for fully configurable IP...
slirp: Rework external configuration interface
With the internal IP configuration made more flexible, we can nowenhance the user interface. This patch adds a number of new options to"-net user": net (address and mask), host, dhcpstart, dns and smbserver....
slirp: Fix port comparision in slirp_remove_hostfwd
For UDP host forwardings, fport is not stable, every outgoing packet ofthe redirection can modify it. Use getsockname instead to look up theport that is actually used on the host side.
slirp: Bind support for host forwarding rules
Extend the hostfwd rule format so that the user can specify on whichhost interface qemu should listen for incoming connections. If omitted,binding will takes place against all interfaces.
slirp: Prepare for persistent socket state flags
This prepares for adding flags to socket.so_state that must not beremoved during the lifetime of a socket.
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.
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
slirp: Move smb, redir, tftp and bootp parameters and -net channel
So far a couple of slirp-related parameters were expressed viastand-alone command line options. This it inconsistent and unintuitive.Moreover, it prevents both dynamically reconfigured (host_net_add/...
slirp: Reorder initialization
This patch reorders the initialization of slirp itself as well as itsassociated features smb and redirection. So far the first reference toslirp triggered the initialization, independent of the actual -net useroption which may carry additional parameters. Now we save any request to...
User networking: Show active connections
In case you're wondering what connections exactly you have openor maybe redir'ed in the past, you can't really find out from qemuright now.
This patch enables you to see all current connections the hostonly networking holds open, so you can kill them using the previous...
User Networking: Enable removal of redirections
Using the new host_net_redir command you can easily create redirectionson the fly while your VM is running.
While that's great, it's missing the removal of redirections, in case youwant to have a port closed again at a later point in time....
Cast pointer arguments of get/setsockopt, send to void * to keep GCCfrom producing a warning about pointer type mismatches with Winsock
Signed-off-by: malc <av1474@comtv.ru>
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
Fix 64 bit issue in slirp
Signed-off-by: Gleb Natapov <gleb@redhat.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6288 c046a42c-6fe2-441c-8c8c-71466251a162
Fix some SLIRP warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6272 c046a42c-6fe2-441c-8c8c-71466251a162
Add support for vmchannel socket migration (Gleb Natapov)
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6243 c046a42c-6fe2-441c-8c8c-71466251a162
Add slirp_restrict option (Gleb Natapov)
Add "slirp firewall" to permit connection only to vmchannel addresses.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6241 c046a42c-6fe2-441c-8c8c-71466251a162
Redirect slirp traffic to/from qemu character device (Gleb Natapov)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6240 c046a42c-6fe2-441c-8c8c-71466251a162
slirp: fix CVE 2007-5729
The emulated network cards in QEMU allows local users to execute arbitrarycode by writing Ethernet frames with a size larger than the slirp's defaultMTU, which triggers a heap-based buffer overflow in the slirp library.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
added explicit license
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5499 c046a42c-6fe2-441c-8c8c-71466251a162
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
Fix OpenBSD linker warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162
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
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
Make Slirp statistics gathering and output conditional to LOG_ENABLEDAdd 'info slirp' command to monitor to display statisticsDisable Slirp debugging code by default
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3451 c046a42c-6fe2-441c-8c8c-71466251a162
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
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
suppressed unaligned accesses
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1911 c046a42c-6fe2-441c-8c8c-71466251a162
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
removed warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1871 c046a42c-6fe2-441c-8c8c-71466251a162
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
Downgrade DNS failure to a warning.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1815 c046a42c-6fe2-441c-8c8c-71466251a162
Set slirp client hostname.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1813 c046a42c-6fe2-441c-8c8c-71466251a162
improved user net performances
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1561 c046a42c-6fe2-441c-8c8c-71466251a162
windows fixes (Gregory Alexander)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1102 c046a42c-6fe2-441c-8c8c-71466251a162
allow inetd like program exec
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1060 c046a42c-6fe2-441c-8c8c-71466251a162
port redirection support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1054 c046a42c-6fe2-441c-8c8c-71466251a162
win32 compile
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1016 c046a42c-6fe2-441c-8c8c-71466251a162
forgot fclose()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@979 c046a42c-6fe2-441c-8c8c-71466251a162
fixed dhcp for windows client
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@784 c046a42c-6fe2-441c-8c8c-71466251a162
initial user mode network support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@733 c046a42c-6fe2-441c-8c8c-71466251a162