0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

modules: more GET_SS_FAMILY() checking

This commit is contained in:
William Pitcock 2016-03-20 04:46:50 -05:00
parent 570bbefb54
commit 032ef5ef9e
3 changed files with 4 additions and 4 deletions

View file

@ -56,7 +56,7 @@ eb_hostmask(const char *banstr, struct Client *client_p, struct Channel *chptr,
#ifdef RB_IPV6
/* handle Teredo if necessary */
if (client_p->localClient->ip.ss_family == AF_INET6 && ipv4_from_ipv6((const struct sockaddr_in6 *) &client_p->localClient->ip, &ip4))
if (GET_SS_FAMILY(&client_p->localClient->ip) == AF_INET6 && ipv4_from_ipv6((const struct sockaddr_in6 *) &client_p->localClient->ip, &ip4))
{
sprintf(src_ip4host, "%s!%s@", client_p->name, client_p->username);
s4 = src_ip4host + strlen(src_ip4host);

View file

@ -165,8 +165,8 @@ do_etrace(struct Client *source_p, int ipv4, int ipv6)
target_p = ptr->data;
#ifdef RB_IPV6
if((!ipv4 && target_p->localClient->ip.ss_family == AF_INET) ||
(!ipv6 && target_p->localClient->ip.ss_family == AF_INET6))
if((!ipv4 && GET_SS_FAMILY(&target_p->localClient->ip) == AF_INET) ||
(!ipv6 && GET_SS_FAMILY(&target_p->localClient->ip) == AF_INET6))
continue;
#endif

View file

@ -367,7 +367,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
target_p->name, target_p->sockhost);
#ifdef RB_IPV6
if (target_p->localClient->ip.ss_family == AF_INET6 &&
if (GET_SS_FAMILY(&target_p->localClient->ip) == AF_INET6 &&
(show_ip(source_p, target_p) ||
(source_p == target_p && !IsIPSpoof(target_p))) &&
ipv4_from_ipv6((struct sockaddr_in6 *)&target_p->localClient->ip, &ip4))