diff options
author | Peter Powell <petpow@saberuk.com> | 2018-07-13 00:47:53 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-07-18 19:21:45 +0100 |
commit | 87e328a1fbfcacafc013ba580d31dd4123f1e7e2 (patch) | |
tree | 5e7368079fec41e74cd0c30a6b80fa6da7b9599b /src/modules | |
parent | 8f5952d1e56c9dbefebbacfc7e40546a9df901e8 (diff) |
Add the family() member to the sockaddrs union.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_cloaking.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_connectban.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_ident.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 515244231..87ff14a9d 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -223,7 +223,7 @@ class ModuleCloaking : public Module size_t hop1, hop2, hop3; size_t len1, len2; std::string rv; - if (ip.sa.sa_family == AF_INET6) + if (ip.family() == AF_INET6) { bindata = std::string((const char*)ip.in6.sin6_addr.s6_addr, 16); hop1 = 8; @@ -267,7 +267,7 @@ class ModuleCloaking : public Module } else { - if (ip.sa.sa_family == AF_INET6) + if (ip.family() == AF_INET6) { rv.append(InspIRCd::Format(".%02x%02x.%02x%02x%s", ip.in6.sin6_addr.s6_addr[2], ip.in6.sin6_addr.s6_addr[3], diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 906724249..d57ffca02 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -54,7 +54,7 @@ class ModuleConnectBan : public Module unsigned char range = 32; - switch (u->client_sa.sa.sa_family) + switch (u->client_sa.family()) { case AF_INET6: range = ipv6_cidr; diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 16694de93..95913c235 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -348,7 +348,7 @@ class ModuleDNSBL : public Module, public Stats::EventListener ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "User has no connect class in OnSetUserIP"); std::string reversedip; - if (user->client_sa.sa.sa_family == AF_INET) + if (user->client_sa.family() == AF_INET) { unsigned int a, b, c, d; d = (unsigned int) (user->client_sa.in4.sin_addr.s_addr >> 24) & 0xFF; @@ -358,7 +358,7 @@ class ModuleDNSBL : public Module, public Stats::EventListener reversedip = ConvToStr(d) + "." + ConvToStr(c) + "." + ConvToStr(b) + "." + ConvToStr(a); } - else if (user->client_sa.sa.sa_family == AF_INET6) + else if (user->client_sa.family() == AF_INET6) { const unsigned char* ip = user->client_sa.in6.sin6_addr.s6_addr; diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 4b110ccd6..f645a77ff 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -92,7 +92,7 @@ class IdentRequestSocket : public EventHandler { age = ServerInstance->Time(); - SetFd(socket(user->server_sa.sa.sa_family, SOCK_STREAM, 0)); + SetFd(socket(user->server_sa.family(), SOCK_STREAM, 0)); if (GetFd() == -1) throw ModuleException("Could not create socket"); @@ -105,7 +105,7 @@ class IdentRequestSocket : public EventHandler memcpy(&bindaddr, &user->server_sa, sizeof(bindaddr)); memcpy(&connaddr, &user->client_sa, sizeof(connaddr)); - if (connaddr.sa.sa_family == AF_INET6) + if (connaddr.family() == AF_INET6) { bindaddr.in6.sin6_port = 0; connaddr.in6.sin6_port = htons(113); @@ -148,7 +148,7 @@ class IdentRequestSocket : public EventHandler /* Build request in the form 'localport,remoteport\r\n' */ int req_size; - if (user->client_sa.sa.sa_family == AF_INET6) + if (user->client_sa.family() == AF_INET6) req_size = snprintf(req, sizeof(req), "%d,%d\r\n", ntohs(user->client_sa.in6.sin6_port), ntohs(user->server_sa.in6.sin6_port)); else diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 2fd578698..0b311a0bd 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -243,7 +243,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y) irc::sockets::sockaddrs bind; if ((!x->Bind.empty()) && (irc::sockets::aptosa(x->Bind, 0, bind))) { - if (bind.sa.sa_family == AF_INET) + if (bind.family() == AF_INET) start_type = DNS::QUERY_A; } |