浏览代码

Wire MTU through to service.

Adam Ierymenko 8 年之前
父节点
当前提交
e5e90b1f71
共有 1 个文件被更改,包括 9 次插入8 次删除
  1. 9 8
      service/OneService.cpp

+ 9 - 8
service/OneService.cpp

@@ -2082,16 +2082,17 @@ public:
 				memcpy(&(n.config),nwc,sizeof(ZT_VirtualNetworkConfig));
 				if (n.tap) { // sanity check
 #ifdef __WINDOWS__
-                    // wait for up to 5 seconds for the WindowsEthernetTap to actually be initialized
-                    // 
-                    // without WindowsEthernetTap::isInitialized() returning true, the won't actually
-                    // be online yet and setting managed routes on it will fail.
-                    const int MAX_SLEEP_COUNT = 500;
-                    for (int i = 0; !n.tap->isInitialized() && i < MAX_SLEEP_COUNT; i++) {
-                        Sleep(10);
-                    }
+					// wait for up to 5 seconds for the WindowsEthernetTap to actually be initialized
+					// 
+					// without WindowsEthernetTap::isInitialized() returning true, the won't actually
+					// be online yet and setting managed routes on it will fail.
+					const int MAX_SLEEP_COUNT = 500;
+					for (int i = 0; !n.tap->isInitialized() && i < MAX_SLEEP_COUNT; i++) {
+						Sleep(10);
+					}
 #endif
 					syncManagedStuff(n,true,true);
+					n.tap->setMtu(nwc->mtu);
 				} else {
 					_nets.erase(nwid);
 					return -999; // tap init failed