From f88fbaa2fe91c22f1c7280ecd96c2bcf92f73a4d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 11 Aug 2022 14:20:18 +0100 Subject: 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. --- src/modules/m_spanningtree/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree/utils.cpp') diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 3afe0fddb..798df840f 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -212,8 +212,8 @@ void SpanningTreeUtilities::RefreshIPCache() ValidIPs.insert(ValidIPs.end(), L->AllowMasks.begin(), L->AllowMasks.end()); - irc::sockets::sockaddrs dummy; - bool ipvalid = irc::sockets::aptosa(L->IPAddr, L->Port, dummy); + irc::sockets::sockaddrs dummy(false); + bool ipvalid = dummy.from_ip_port(L->IPAddr, L->Port); if ((L->IPAddr == "*") || (isunix) || (ipvalid)) ValidIPs.push_back(L->IPAddr); else if (this->Creator->DNS) -- cgit v1.3.1-10-gc9f91