Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ambrop72/badvpn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmbroz Bizjak <ambrop7@gmail.com>2016-11-13 18:52:38 +0300
committerAmbroz Bizjak <ambrop7@gmail.com>2016-11-13 18:52:38 +0300
commit3940ed01b4c611485977bad4da38283e0cf48ec2 (patch)
tree215bbd32160514b5ec5999f6785fff7bf296aaa3
parent2b6f4d55052a8bcca3c0c8a1241a6b3946a791da (diff)
Fix TUN/TAP initialization with newer TAP-Windows.
-rw-r--r--tuntap/BTap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tuntap/BTap.c b/tuntap/BTap.c
index c30bf71..52a69d7 100644
--- a/tuntap/BTap.c
+++ b/tuntap/BTap.c
@@ -268,9 +268,9 @@ int BTap_Init2 (BTap *o, BReactor *reactor, struct BTap_init_data init_data, BTa
// get MTU
- ULONG umtu;
+ ULONG umtu = 0;
- if (!DeviceIoControl(o->device, TAP_IOCTL_GET_MTU, NULL, 0, &umtu, sizeof(umtu), &len, NULL)) {
+ if (!DeviceIoControl(o->device, TAP_IOCTL_GET_MTU, &umtu, sizeof(umtu), &umtu, sizeof(umtu), &len, NULL)) {
BLog(BLOG_ERROR, "DeviceIoControl(TAP_IOCTL_GET_MTU) failed");
goto fail2;
}