[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Network functions patches for win32
From: |
Pavel Dovgaluk |
Subject: |
[Qemu-devel] [PATCH] Network functions patches for win32 |
Date: |
Thu, 10 Feb 2011 12:16:09 +0300 |
This patch contains some fixes for network functions, working in Windows
environment, and consists of two parts:
1. net/socket.c fix
MSDN includes the following in WSAEALREADY error description for connect()
function: "To preserve backward compatibility, this error is reported as
WSAEINVAL to Winsock applications that link to either Winsock.dll or
Wsock32.dll". So check of this error code was added to allow network
connections through the sockets in Windows.
2. net/tap-win32.c fix
This fix allows connection of internal VLAN to the external TAP interface.
If tap_win32_write function always returns 0, the TAP network interface
in QEMU is disabled.
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
net/socket.c | 2 +-
net/tap-win32.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 3182b37..7337f4f 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -457,7 +457,7 @@ static int net_socket_connect_init(VLANState *vlan,
} else if (err == EINPROGRESS) {
break;
#ifdef _WIN32
- } else if (err == WSAEALREADY) {
+ } else if (err == WSAEALREADY || err == WSAEINVAL) {
break;
#endif
} else {
diff --git a/net/tap-win32.c b/net/tap-win32.c
index 081904e..596132e 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -480,7 +480,7 @@ static int tap_win32_write(tap_win32_overlapped_t
*overlapped,
}
}
- return 0;
+ return write_size;
}
static DWORD WINAPI tap_win32_thread_entry(LPVOID param)
- [Qemu-devel] [PATCH] Network functions patches for win32,
Pavel Dovgaluk <=