aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-07-22 17:03:52 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-22 15:41:02 -0500
commitb0dc78730e54bd3ef96f56466890aa2509a328c3 (patch)
treeb460e79587919763952fbcd145fa5aff919e4a20 /net.c
parentcc234b83c6bca8a79fa4e385b520155f2d1d3ba7 (diff)
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 <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net.c b/net.c
index 90cf912378..1c2c7d06a8 100644
--- a/net.c
+++ b/net.c
@@ -1150,7 +1150,7 @@ static void slirp_smb(SlirpState* s, Monitor *mon, const char *exported_dir,
snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s",
SMBD_COMMAND, smb_conf);
- if (slirp_add_exec(s->slirp, 0, smb_cmdline, vserver_addr, 139) < 0) {
+ if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
slirp_smb_cleanup(s);
config_error(mon, "conflicting/invalid smbserver address\n");
}
@@ -1239,16 +1239,17 @@ static void slirp_guestfwd(SlirpState *s, Monitor *mon, const char *config_str,
qemu_free(fwd);
return;
}
- fwd->server = server;
- fwd->port = port;
- fwd->slirp = s->slirp;
- if (slirp_add_exec(s->slirp, 3, fwd->hd, server, port) < 0) {
+ if (slirp_add_exec(s->slirp, 3, fwd->hd, &server, port) < 0) {
config_error(mon, "conflicting/invalid host:port in guest forwarding "
"rule '%s'\n", config_str);
qemu_free(fwd);
return;
}
+ fwd->server = server;
+ fwd->port = port;
+ fwd->slirp = s->slirp;
+
qemu_chr_add_handlers(fwd->hd, guestfwd_can_read, guestfwd_read,
NULL, fwd);
return;