Преглед на файлове

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
     
-    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;
     }