164 |
|
|
165 |
|
ClearDNSPending(auth); |
166 |
|
|
167 |
< |
if (name != NULL) |
167 |
> |
if (name) |
168 |
|
{ |
169 |
|
const struct sockaddr_in *v4, *v4dns; |
170 |
|
#ifdef IPV6 |
177 |
|
{ |
178 |
|
v6 = (const struct sockaddr_in6 *)&auth->client->localClient->ip; |
179 |
|
v6dns = (const struct sockaddr_in6 *)addr; |
180 |
+ |
|
181 |
|
if (memcmp(&v6->sin6_addr, &v6dns->sin6_addr, sizeof(struct in6_addr)) != 0) |
182 |
|
{ |
183 |
|
sendheader(auth->client, REPORT_IP_MISMATCH); |
189 |
|
{ |
190 |
|
v4 = (const struct sockaddr_in *)&auth->client->localClient->ip; |
191 |
|
v4dns = (const struct sockaddr_in *)addr; |
192 |
< |
if(v4->sin_addr.s_addr != v4dns->sin_addr.s_addr) |
192 |
> |
|
193 |
> |
if (v4->sin_addr.s_addr != v4dns->sin_addr.s_addr) |
194 |
|
{ |
195 |
|
sendheader(auth->client, REPORT_IP_MISMATCH); |
196 |
|
good = 0; |
197 |
|
} |
198 |
|
} |
199 |
+ |
|
200 |
|
if (good && strlen(name) <= HOSTLEN) |
201 |
|
{ |
202 |
|
strlcpy(auth->client->host, name, |
367 |
|
* side effects - starts auth (identd) and dns queries for a client |
368 |
|
*/ |
369 |
|
void |
370 |
< |
start_auth(struct Client *client) |
370 |
> |
start_auth(struct Client *client_p) |
371 |
|
{ |
372 |
|
struct AuthRequest *auth = NULL; |
373 |
|
|
374 |
< |
assert(client != NULL); |
374 |
> |
assert(client_p); |
375 |
|
|
376 |
< |
auth = make_auth_request(client); |
376 |
> |
auth = make_auth_request(client_p); |
377 |
|
SetInAuth(auth); |
378 |
|
dlinkAddTail(auth, &auth->node, &auth_doing_list); |
379 |
|
|
380 |
< |
sendheader(client, REPORT_DO_DNS); |
380 |
> |
sendheader(client_p, REPORT_DO_DNS); |
381 |
|
|
382 |
|
SetDNSPending(auth); |
383 |
|
|
387 |
|
start_auth_query(auth); |
388 |
|
} |
389 |
|
|
390 |
< |
gethost_byaddr(auth_dns_callback, auth, &client->localClient->ip); |
390 |
> |
gethost_byaddr(auth_dns_callback, auth, &client_p->localClient->ip); |
391 |
|
} |
392 |
|
|
393 |
|
/* |
397 |
|
static void |
398 |
|
timeout_auth_queries_event(void *notused) |
399 |
|
{ |
400 |
< |
dlink_node *ptr = NULL, *next_ptr = NULL; |
400 |
> |
dlink_node *ptr = NULL, *ptr_next = NULL; |
401 |
|
|
402 |
< |
DLINK_FOREACH_SAFE(ptr, next_ptr, auth_doing_list.head) |
402 |
> |
DLINK_FOREACH_SAFE(ptr, ptr_next, auth_doing_list.head) |
403 |
|
{ |
404 |
|
struct AuthRequest *auth = ptr->data; |
405 |
|
|
460 |
|
return; |
461 |
|
} |
462 |
|
|
463 |
< |
if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us, |
464 |
< |
&ulen) || |
462 |
< |
getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them, |
463 |
< |
&tlen)) |
463 |
> |
if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us, &ulen) || |
464 |
> |
getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them, &tlen)) |
465 |
|
{ |
466 |
|
ilog(LOG_TYPE_IRCD, "auth get{sock,peer}name error for %s", |
467 |
< |
get_client_name(auth->client, SHOW_IP)); |
467 |
> |
get_client_name(auth->client, SHOW_IP)); |
468 |
|
auth_error(auth); |
469 |
|
return; |
470 |
|
} |