Selaa lähdekoodia

Fix TUN/TAP initialization with newer TAP-Windows.

Ambroz Bizjak 9 vuotta sitten
vanhempi
sitoutus
3940ed01b4
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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;
     }