aboutsummaryrefslogtreecommitdiff
path: root/src/cidr.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-08-11 14:20:18 +0100
committerGravatar Sadie Powell2022-08-11 15:40:57 +0100
commitf88fbaa2fe91c22f1c7280ecd96c2bcf92f73a4d (patch)
treee35803070a6ca8e50ee2d07b2e6c0d71230d53f3 /src/cidr.cpp
parentClean up the sockaddrs documentation comments. (diff)
Move aptosa/untosa into the sockaddrs union and add from/from_ip.
The struct will also now always be zero-initialized by default which removes the footgun which has happened previously where the union has been accessed before being initialized leading to it containing weird values.
Diffstat (limited to 'src/cidr.cpp')
-rw-r--r--src/cidr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cidr.cpp b/src/cidr.cpp
index f45c63b98..f7401fe92 100644
--- a/src/cidr.cpp
+++ b/src/cidr.cpp
@@ -76,8 +76,8 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr
return false;
}
- irc::sockets::sockaddrs addr;
- if (!irc::sockets::aptosa(address_copy, 0, addr))
+ irc::sockets::sockaddrs addr(false);
+ if (!addr.from_ip(address_copy))
{
// The address could not be parsed.
return false;