aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-02-10 17:34:02 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-02-10 17:34:02 +0000
commit3b7f5d479caf9b51e99da9940619db720637d5b4 (patch)
tree16a0f42fb73a1a40c13bfffae6ab88ab3c8347e6 /vl.c
parent1247c5f7be51595edd622e0e0a8d26e24fb88327 (diff)
Avoid crash if -redir or -smb used without -net user.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1760 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 97eddbf499..8d1fa3747d 100644
--- a/vl.c
+++ b/vl.c
@@ -1926,7 +1926,7 @@ static VLANClientState *slirp_vc;
int slirp_can_output(void)
{
- return qemu_can_send_packet(slirp_vc);
+ return !slirp_vc || qemu_can_send_packet(slirp_vc);
}
void slirp_output(const uint8_t *pkt, int pkt_len)
@@ -1935,6 +1935,8 @@ void slirp_output(const uint8_t *pkt, int pkt_len)
printf("slirp output:\n");
hex_dump(stdout, pkt, pkt_len);
#endif
+ if (!slirp_vc)
+ return;
qemu_send_packet(slirp_vc, pkt, pkt_len);
}