0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd: blacklist: use GET_SS_FAMILY()

This commit is contained in:
William Pitcock 2016-03-20 01:48:14 -05:00
parent e0dc28c59f
commit 1d90b085d3

View file

@ -156,7 +156,7 @@ static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *
blcptr->client_p = client_p;
/* IPv4 */
if ((client_p->localClient->ip.ss_family == AF_INET) && blptr->ipv4)
if ((GET_SS_FAMILY(&client_p->localClient->ip) == AF_INET) && blptr->ipv4)
{
ip = (uint8_t *)&((struct sockaddr_in *)&client_p->localClient->ip)->sin_addr.s_addr;
@ -168,8 +168,9 @@ static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *
(unsigned int) ip[0],
blptr->host);
}
#ifdef RB_IPV6
/* IPv6 */
else if ((client_p->localClient->ip.ss_family == AF_INET6) && blptr->ipv6)
else if ((GET_SS_FAMILY(&client_p->localClient->ip) == AF_INET6) && blptr->ipv6)
{
/* Split up for rDNS lookup
* ex: ip[0] = 0x00, ip[1] = 0x00... ip[16] = 0x01 for localhost
@ -197,6 +198,7 @@ static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *
/* Tack host on */
strcpy(bufptr, blptr->host);
}
#endif
/* This shouldn't happen... */
else
return;