51 |
#include "log.h" |
#include "log.h" |
52 |
#include "send.h" |
#include "send.h" |
53 |
#include "memory.h" |
#include "memory.h" |
54 |
|
#include "misc.h" |
55 |
|
|
56 |
|
|
57 |
enum |
enum |
191 |
auth_sendheader(auth->client, REPORT_FAIL_DNS); |
auth_sendheader(auth->client, REPORT_FAIL_DNS); |
192 |
else |
else |
193 |
{ |
{ |
194 |
if (auth->client->ip.ss.ss_family == AF_INET6) |
if (address_compare(addr, &auth->client->ip, false) == false) |
195 |
{ |
auth_sendheader(auth->client, REPORT_IP_MISMATCH); |
196 |
const struct sockaddr_in6 *const v6 = (const struct sockaddr_in6 *)&auth->client->ip; |
else if (namelength > HOSTLEN) |
|
const struct sockaddr_in6 *const v6dns = (const struct sockaddr_in6 *)addr; |
|
|
|
|
|
if (memcmp(&v6->sin6_addr, &v6dns->sin6_addr, sizeof(struct in6_addr))) |
|
|
{ |
|
|
auth_sendheader(auth->client, REPORT_IP_MISMATCH); |
|
|
auth_release_client(auth); |
|
|
return; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
const struct sockaddr_in *const v4 = (const struct sockaddr_in *)&auth->client->ip; |
|
|
const struct sockaddr_in *const v4dns = (const struct sockaddr_in *)addr; |
|
|
|
|
|
if (v4->sin_addr.s_addr != v4dns->sin_addr.s_addr) |
|
|
{ |
|
|
auth_sendheader(auth->client, REPORT_IP_MISMATCH); |
|
|
auth_release_client(auth); |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
if (namelength > HOSTLEN) |
|
197 |
auth_sendheader(auth->client, REPORT_HOST_TOOLONG); |
auth_sendheader(auth->client, REPORT_HOST_TOOLONG); |
198 |
else if (auth_verify_hostname(name) == false) |
else if (auth_verify_hostname(name) == false) |
199 |
auth_sendheader(auth->client, REPORT_HOST_INVALID); |
auth_sendheader(auth->client, REPORT_HOST_INVALID); |