ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/src/auth.c
(Generate patch)

Comparing ircd-hybrid/branches/8.2.x/src/auth.c (file contents):
Revision 8879 by michael, Sat Feb 16 21:53:04 2019 UTC vs.
Revision 8880 by michael, Sun Apr 14 16:02:11 2019 UTC

# Line 51 | Line 51
51   #include "log.h"
52   #include "send.h"
53   #include "memory.h"
54 + #include "misc.h"
55  
56  
57   enum
# Line 190 | Line 191 | auth_dns_callback(void *vptr, const stru
191      auth_sendheader(auth->client, REPORT_FAIL_DNS);
192    else
193    {
194 <    if (auth->client->ip.ss.ss_family == AF_INET6)
195 <    {
196 <      const struct sockaddr_in6 *const v6 = (const struct sockaddr_in6 *)&auth->client->ip;
196 <      const struct sockaddr_in6 *const v6dns = (const struct sockaddr_in6 *)addr;
197 <
198 <      if (memcmp(&v6->sin6_addr, &v6dns->sin6_addr, sizeof(struct in6_addr)))
199 <      {
200 <        auth_sendheader(auth->client, REPORT_IP_MISMATCH);
201 <        auth_release_client(auth);
202 <        return;
203 <      }
204 <    }
205 <    else
206 <    {
207 <      const struct sockaddr_in *const v4 = (const struct sockaddr_in *)&auth->client->ip;
208 <      const struct sockaddr_in *const v4dns = (const struct sockaddr_in *)addr;
209 <
210 <      if (v4->sin_addr.s_addr != v4dns->sin_addr.s_addr)
211 <      {
212 <        auth_sendheader(auth->client, REPORT_IP_MISMATCH);
213 <        auth_release_client(auth);
214 <        return;
215 <      }
216 <    }
217 <
218 <    if (namelength > HOSTLEN)
194 >    if (address_compare(addr, &auth->client->ip, false) == false)
195 >      auth_sendheader(auth->client, REPORT_IP_MISMATCH);
196 >    else if (namelength > HOSTLEN)
197        auth_sendheader(auth->client, REPORT_HOST_TOOLONG);
198      else if (auth_verify_hostname(name) == false)
199        auth_sendheader(auth->client, REPORT_HOST_INVALID);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines