summaryrefslogtreecommitdiff
path: root/net/slirp.c
AgeCommit message (Collapse)AuthorFilesLines
2012-05-01Declare state directory in smb.confNikolaus Rath1-0/+2
The smb.conf generated by the userspace networking does not include a state directory directive. Samba therefore falls back to the default value. Since the user generally does not have write access to this path, smbd immediately crashes. The "state directory" option was added in Samba 3.4.0 (commit http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757). This patch adds the missing option. Signed-off-by: Nikolaus Rath <Nikolaus@rath.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-05-01slirp: don't use "smb ports = 0" optionNikolaus Rath1-1/+0
The "smb ports = 0" option causes recent samba versions to crash. It was introduced in commit 157777ef3e with log message "Samba 3 support". However, a value of 0 has never been officially supported by smb and is also not necessary: if stdin is a socket, smb does not try to listen on any ports and uses just stdin. This is necessary to support inetd based operation (otherwise smbd would always fail when called from inetd, because inetd already listens on the SMB port). Since samba has supported inetd operation since pre-3.x, it should be safe to rely on this feature. I have tested it with Samba 3.6.4 -- communication works fine, and smbd is not listening on any ports. I suspect the "smb ports = 0" hack may have been introduced when someone tested the qemu generated samba config from the command line with "smbd -i" and found it to fail (because then stdin isn't a socket). Signed-off-by: Nikolaus Rath <Nikolaus@rath.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2011-12-19slirp: Fix typo in net_slirp_hostfwd_removeGeoffrey Thomas1-1/+1
Report an error when err is nonzero, not when it is zero. Signed-off-by: Geoffrey Thomas <geofft@ldpreload.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-22slirp: Clean up net_slirp_hostfwd_remove()'s use of get_str_sep()Markus Armbruster1-5/+4
get_str_sep() can fail, but net_slirp_hostfwd_remove() doesn't check. Works, because it initializes buf[] to "", which get_str_sep() doesn't touch when it fails. Coverity doesn't like it, and neither do I. Change it to work exactly like slirp_hostfwd(). Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-09-03Allow overriding the location of Samba's smbd.Brad1-1/+1
Allow overriding the location of Samba's smbd. Pretty much every OS I look at has some means of changing this path (patching) so lets just make it easier for OS developers creating packages and/or end users to override the location. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-22char: rename qemu_chr_open() -> qemu_chr_new()Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-11/+11
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23net: Refactor net_client_typesJan Kiszka1-1/+1
Position entries of net_client_types according to the corresponding values of NET_CLIENT_TYPE_*. The array size is now defined by NET_CLIENT_TYPE_MAX. This will allow to obtain entries based on type value in later patches. At this chance rename NET_CLIENT_TYPE_SLIRP to NET_CLIENT_TYPE_USER for the sake of consistency. CC: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23slirp: Canonicalize restrict syntaxJan Kiszka1-6/+15
All other boolean arguments accept on|off - except for slirp's restrict. Fix that while still accepting the formerly allowed yes|y|no|n, but reject everything else. This avoids accidentally allowing external connections because syntax errors were so far interpreted as 'restrict=no'. CC: Gleb Natapov <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-08slirp: fix guestfwd idAlexander Graf1-1/+1
When using -net user,guestfwd=... Qemu immediately complains about the id being in invalid format. This is because we pass in an id that contains a colon, while the id restrictions don't allow colons. This patch changes the colon into a dot, making guestfwd work again. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-15Remove unused sysemu.h include directivesBlue Swirl1-1/+0
Remove unused sysemu.h include directives to speed up build with the following patches. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-16error: Replace qemu_error() by error_report()Markus Armbruster1-14/+14
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
2010-03-09slirp: check system() successJuan Quintela1-1/+1
we shouldn't call W*() macros until we check that fork worked. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19net: Fix bogus "Warning: vlan 0 with no nics" with -deviceMarkus Armbruster1-4/+0
net_check_clients() prints this when an VLAN has host devices, but no guest devices. It uses VLANState members nb_guest_devs and nb_host_devs to keep track of these devices. However, -device does not update nb_guest_devs, only net_init_nic() does that, for -net nic. Check the VLAN clients directly, and remove the counters. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-27Fix BSD buildBlue Swirl1-0/+3
<sys/wait.h> must be included in order to use WIF* macros. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-26net/slirp.c: fix warning with _FORTIFY_SOURCEKirill A. Shutemov1-1/+8
CC net/slirp.o cc1: warnings being treated as errors net/slirp.c: In function 'slirp_smb_cleanup': net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result make: *** [net/slirp.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03net: convert slirp to NetClientInfoMark McLoughlin1-24/+37
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03net: move slirp code from net.c to net/slirp.cMark McLoughlin1-0/+752
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>