Windows host tap (tap-win32) is not working on QEMU ver 0.12.X
Public bug reported:
To reproduce the bug:
1) Install tap driver from openvpn (either v8/v9). Rename the tap connection to "mytap" and set the IP to 192.168.1.1 (or any ip)
2) use any QEMU 0.12.X and issue the following command
c:\qemu> qemu -net nic -net tap,ifname=mytap -cdrom ../linux.iso
3) Inside linux guest system, set the ip of the nic
# ifconfig eth0 192.168.1.2
4) In the windows host try to ping the linux guest (or the other way around, after you disable the windows firewall)
c:\qemu> ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data:
Reply from 192.168.1.1: Destination host unreachable.
Those above steps is not working on QEMU 0.12.X. But confirmed working (ping successful) on:
- QEMU 0.9.X
- QEMU 0.10.X
- QEMU 0.11.X
I have tried with windows XP and windows 7 host system. I haven't tried the qemu latest from git repository, but looking at the "net/tap- win32.c" revision date, I guess the bug has been around for a while.
Thanks.
** Affects: qemu
Importance: Undecided
Status: New
Signature · 34 lines
Windows host tap (tap-win32) is not working on QEMU ver 0.12.X https://bugs.launchpad.net/bugs/589564 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Bug description: To reproduce the bug: 1) Install tap driver from openvpn (either v8/v9). Rename the tap connection to "mytap" and set the IP to 192.168.1.1 (or any ip) 2) use any QEMU 0.12.X and issue the following command c:\qemu> qemu -net nic -net tap,ifname=mytap -cdrom ../linux.iso 3) Inside linux guest system, set the ip of the nic # ifconfig eth0 192.168.1.2 4) In the windows host try to ping the linux guest (or the other way around, after you disable the windows firewall) c:\qemu> ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.1: Destination host unreachable. Those above steps is not working on QEMU 0.12.X. But confirmed working (ping successful) on: - QEMU 0.9.X - QEMU 0.10.X - QEMU 0.11.X I have tried with windows XP and windows 7 host system. I haven't tried the qemu latest from git repository, but looking at the "net/tap-win32.c" revision date, I guess the bug has been around for a while. Thanks.
I also had the same problem with 0.12.x version.
BTW, I slightly changed source code to avoid this problem.
Here is what I did for this below.
I haven't taken analysis of this operation details so my apporach may not be the right solution. (Sorry for that). Anyway, refer to my comment (deleted for tap).
file : net.c
static ssize_t qemu_vlan_deliver_packet(VLANClientState *sender,
unsigned flags, const uint8_t *buf, size_t size, void *opaque)
{
VLANState *vlan = opaque;
VLANClientState *vc;
ssize_t ret = -1;
QTAILQ_FOREACH(vc, &vlan->clients, next) {
ssize_t len;
if (vc == sender) {
continue;
}
if (vc->link_down) {
ret = size;
continue;
}
/* deleted for tap
if (vc->receive_disabled) {
ret = 0;
continue;
}
*/
if (flags & QEMU_NET_PACKET_FLAG_RAW && vc->info->receive_raw) {
len = vc->info->receive_raw(vc, buf, size);
} else {
len = vc->info->receive(vc, buf, size);
}
/* deleted for tap
if (len == 0) {
vc->receive_disabled = 1;
}
*/
ret = (ret >= 0) ? ret : len;
}
return ret;
}Signature · 34 lines
Windows host tap (tap-win32) is not working on QEMU ver 0.12.X https://bugs.launchpad.net/bugs/589564 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Bug description: To reproduce the bug: 1) Install tap driver from openvpn (either v8/v9). Rename the tap connection to "mytap" and set the IP to 192.168.1.1 (or any ip) 2) use any QEMU 0.12.X and issue the following command c:\qemu> qemu -net nic -net tap,ifname=mytap -cdrom ../linux.iso 3) Inside linux guest system, set the ip of the nic # ifconfig eth0 192.168.1.2 4) In the windows host try to ping the linux guest (or the other way around, after you disable the windows firewall) c:\qemu> ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.1: Destination host unreachable. Those above steps is not working on QEMU 0.12.X. But confirmed working (ping successful) on: - QEMU 0.9.X - QEMU 0.10.X - QEMU 0.11.X I have tried with windows XP and windows 7 host system. I haven't tried the qemu latest from git repository, but looking at the "net/tap-win32.c" revision date, I guess the bug has been around for a while. Thanks.
maybe this is a better fix
tap-win32.c-orig 2010-07-05 11:33:11 +0200 renamed from tap-win32.c 2010-07-05 11:14:51 +0200 +1 -1
@@ -479,7 +479,7 @@ static int tap_win32_write(tap_win32_ove } } - return 0; + return write_size; } static DWORD WINAPI tap_win32_thread_entry(LPVOID param)
** Patch added: "tap-win32.diff"
http://launchpadlibrarian.net/51405123/tap-win32.diff
Signature · 34 lines
Windows host tap (tap-win32) is not working on QEMU ver 0.12.X https://bugs.launchpad.net/bugs/589564 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Bug description: To reproduce the bug: 1) Install tap driver from openvpn (either v8/v9). Rename the tap connection to "mytap" and set the IP to 192.168.1.1 (or any ip) 2) use any QEMU 0.12.X and issue the following command c:\qemu> qemu -net nic -net tap,ifname=mytap -cdrom ../linux.iso 3) Inside linux guest system, set the ip of the nic # ifconfig eth0 192.168.1.2 4) In the windows host try to ping the linux guest (or the other way around, after you disable the windows firewall) c:\qemu> ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.1: Destination host unreachable. Those above steps is not working on QEMU 0.12.X. But confirmed working (ping successful) on: - QEMU 0.9.X - QEMU 0.10.X - QEMU 0.11.X I have tried with windows XP and windows 7 host system. I haven't tried the qemu latest from git repository, but looking at the "net/tap-win32.c" revision date, I guess the bug has been around for a while. Thanks.
KP. Kang fix is working. But Lode Leroy fix is a more proper approach.
I have tested the patch and confirm that the problem is now fixed using the provided patch.
Signature · 34 lines
Windows host tap (tap-win32) is not working on QEMU ver 0.12.X https://bugs.launchpad.net/bugs/589564 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Bug description: To reproduce the bug: 1) Install tap driver from openvpn (either v8/v9). Rename the tap connection to "mytap" and set the IP to 192.168.1.1 (or any ip) 2) use any QEMU 0.12.X and issue the following command c:\qemu> qemu -net nic -net tap,ifname=mytap -cdrom ../linux.iso 3) Inside linux guest system, set the ip of the nic # ifconfig eth0 192.168.1.2 4) In the windows host try to ping the linux guest (or the other way around, after you disable the windows firewall) c:\qemu> ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.1: Destination host unreachable. Those above steps is not working on QEMU 0.12.X. But confirmed working (ping successful) on: - QEMU 0.9.X - QEMU 0.10.X - QEMU 0.11.X I have tried with windows XP and windows 7 host system. I haven't tried the qemu latest from git repository, but looking at the "net/tap-win32.c" revision date, I guess the bug has been around for a while. Thanks.
Commit c3febae62b646b5bc7aa88b7cffa88160162a94e fixed this problem.
** Changed in: qemu
Status: New => Fix Released
Signature · 45 lines
You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/589564 Title: Windows host tap (tap-win32) is not working on QEMU ver 0.12.X Status in QEMU: Fix Released Bug description: To reproduce the bug: 1) Install tap driver from openvpn (either v8/v9). Rename the tap connection to "mytap" and set the IP to 192.168.1.1 (or any ip) 2) use any QEMU 0.12.X and issue the following command c:\qemu> qemu -net nic -net tap,ifname=mytap -cdrom ../linux.iso 3) Inside linux guest system, set the ip of the nic # ifconfig eth0 192.168.1.2 4) In the windows host try to ping the linux guest (or the other way around, after you disable the windows firewall) c:\qemu> ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.1: Destination host unreachable. Those above steps is not working on QEMU 0.12.X. But confirmed working (ping successful) on: - QEMU 0.9.X - QEMU 0.10.X - QEMU 0.11.X I have tried with windows XP and windows 7 host system. I haven't tried the qemu latest from git repository, but looking at the "net /tap-win32.c" revision date, I guess the bug has been around for a while. Thanks. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/589564/+subscriptions