Skip to content

Commit

Permalink
Merge pull request pocoproject#442 from cryptoknight/develop
Browse files Browse the repository at this point in the history
Use correct prefix length field of Windows IP_ADAPTER_PREFIX structure
  • Loading branch information
aleks-f committed May 10, 2014
2 parents c1eb293 + a6ca6c0 commit 8cbaa4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Net/src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ IPAddress getBroadcastAddress(PIP_ADAPTER_PREFIX pPrefix, const IPAddress& addr,
IPAddress mask(pPrefix->Next->Address);
if ((ipPrefix & mask) == (ipPrefix & addr))
{
if (pprefix) *pprefix = pPrefix->Length;
if (pprefix) *pprefix = pPrefix->PrefixLength;
return IPAddress(pPrefix->Next->Address);
}
}
Expand Down Expand Up @@ -1085,7 +1085,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
broadcastAddress = getBroadcastAddress(pAddress->FirstPrefix, address, &prefixLength);
// if previous call did not do it, make last-ditch attempt for prefix and broadcast
if (prefixLength == 0 && pAddress->FirstPrefix)
prefixLength = pAddress->FirstPrefix->Length;
prefixLength = pAddress->FirstPrefix->PrefixLength;
poco_assert (prefixLength <= 32);
if (broadcastAddress.isWildcard())
{
Expand Down

0 comments on commit 8cbaa4e

Please sign in to comment.