aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-06-29 20:37:22 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-07-02 20:44:27 +0200
commit177a0e491449b9accfa0cf17c138147539071358 (patch)
tree163b252ea7c7204017187f1e0e32ce12831fb7f0 /src/netbase.cpp
parent409bccfbf52b531b2a9d60ac2308f56223931a2e (diff)
Adding CSubNet constructor over a single CNetAddr
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp7
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())