#499 Subsequent IPs on a NIC is not enumerated

Platform_Specific
closed
nobody
Net (141)
5
2012-12-12
2012-01-25
Anonymous
No

Poco::Net::NetworkInterface::list() enumerates only the first IP of each NIC on Windows.
But some NICs may have multi IPs.
I propose the following modification to fix this problem.

----- NetworkInterface.cpp
NetworkInterface::NetworkInterfaceList NetworkInterface::list()
...
if (GetAdaptersInfo(pAdapterInfo, &infoLen) == NO_ERROR)
{
pInfo = pAdapterInfo;
while (pInfo)
{
//del IPAddress address(std::string(pInfo->IpAddressList.IpAddress.String));
/new/ PIP_ADDR_STRING pIpAddressList = &pInfo->IpAddressList;
/new/ while (pIpAddressList)
/new/ {
/new/ IPAddress address(std::string(pIpAddressList->IpAddress.String));
if (!address.isWildcard()) // only return interfaces that have an address assigned.
{
IPAddress subnetMask(std::string(pInfo->IpAddressList.IpMask.String));
IPAddress broadcastAddress(address);
broadcastAddress.mask(subnetMask, IPAddress::broadcast());
std::string name(pInfo->AdapterName);
std::string displayName(pInfo->Description);
result.push_back(NetworkInterface(name, displayName, address, subnetMask, broadcastAddress));
}
/new/ pIpAddressList = pIpAddressList->Next;
/new/ }
pInfo = pInfo->Next;
}
}

Discussion

  • fixed in 1.4.4, rev. 1926

     
  • Hi! Do you know if they make any plugins to assist with SEO? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share. Kudos! http://www.goonhappiestholidays.com/

     
  • Wow that was unusual. I just wrote an really long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say fantastic blog! http://www.sunglassesforsummertime.org/

     
  • Alex Fabijanic
    Alex Fabijanic
    2012-12-12

    • status: open --> closed
     
  • Alex Fabijanic
    Alex Fabijanic
    2012-12-12

    done in 1.4.x and 1.5.x. closing.