diff options
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index adac5c2d07..c9fc7d67f7 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -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()) |