Adding CSubNet constructor over a single CNetAddr

This commit is contained in:
Jonas Schnelli
2015-06-29 20:37:22 +02:00
parent 409bccfbf5
commit 177a0e4914
4 changed files with 23 additions and 2 deletions

View File

@@ -1291,6 +1291,13 @@ CSubNet::CSubNet(const std::string &strSubnet, bool fAllowLookup)
network.ip[x] &= netmask[x];
}
CSubNet::CSubNet(const CNetAddr &addr):
valid(addr.IsValid())
{
memset(netmask, 255, sizeof(netmask));
network = addr;
}
bool CSubNet::Match(const CNetAddr &addr) const
{
if (!valid || !addr.IsValid())