瀏覽代碼

call setFriendlyName() after tap adapter is initialized

Grant Limberg 7 年之前
父節點
當前提交
629a3a2a24
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 3 0
      osdep/WindowsEthernetTap.cpp
  2. 2 0
      osdep/WindowsEthernetTap.hpp

+ 3 - 0
osdep/WindowsEthernetTap.cpp

@@ -472,6 +472,7 @@ WindowsEthernetTap::WindowsEthernetTap(
 	_nwid(nwid),
 	_mtu(mtu),
 	_tap(INVALID_HANDLE_VALUE),
+	_friendlyName(friendlyName),
 	_injectSemaphore(INVALID_HANDLE_VALUE),
 	_pathToHelpers(hp),
 	_run(true),
@@ -1030,6 +1031,8 @@ void WindowsEthernetTap::threadMain()
 			_initialized = true;
 			unsigned int oldmtu = _mtu;
 
+			setFriendlyName(_friendlyName.c_str());
+
 			while (_run) {
 				DWORD waitResult = WaitForMultipleObjectsEx(writeInProgress ? 3 : 2,wait4,FALSE,2500,TRUE);
 				if (!_run) break; // will also break outer while(_run) since _run is false

+ 2 - 0
osdep/WindowsEthernetTap.hpp

@@ -143,6 +143,8 @@ private:
 	std::string _deviceInstanceId;
 	std::string _mySubkeyName;
 
+	std::string _friendlyName;
+
 	std::vector<InetAddress> _assignedIps; // IPs assigned with addIp
 	Mutex _assignedIps_m;