Merge pull request #18 from jingweiz2017/master
Bug Fix: Failed to connect lidar when multi adapter presented with fi…
This commit is contained in:
@@ -99,7 +99,8 @@ bool FindLocalIP(const struct sockaddr_in &client_addr, uint32_t &local_ip) {
|
||||
|
||||
IP_ADAPTER_INFO *pAdapter = reinterpret_cast<IP_ADAPTER_INFO *>(pAdapterInfo.get());
|
||||
if (NO_ERROR == dlRetVal && pAdapter != NULL) {
|
||||
while (GetAdapterState(pAdapter)) {
|
||||
while (pAdapter != NULL) {
|
||||
if (GetAdapterState(pAdapter)) {
|
||||
std::string str_ip = pAdapter->IpAddressList.IpAddress.String;
|
||||
std::string str_mask = pAdapter->IpAddressList.IpMask.String;
|
||||
ULONG host_ip = inet_addr(const_cast<char *>(str_ip.c_str()));
|
||||
@@ -111,9 +112,12 @@ bool FindLocalIP(const struct sockaddr_in &client_addr, uint32_t &local_ip) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pAdapter = pAdapter->Next;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user