瀏覽代碼

Fix TUN/TAP initialization with newer TAP-Windows.

Ambroz Bizjak 9 年之前
父節點
當前提交
3940ed01b4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      tuntap/BTap.c

+ 2 - 2
tuntap/BTap.c

@@ -268,9 +268,9 @@ int BTap_Init2 (BTap *o, BReactor *reactor, struct BTap_init_data init_data, BTa
     
     
     // get MTU
     // 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");
         BLog(BLOG_ERROR, "DeviceIoControl(TAP_IOCTL_GET_MTU) failed");
         goto fail2;
         goto fail2;
     }
     }