]> jfr.im git - solanum.git/blobdiff - ircd/client.c
Add a comment explaining match_arrange_stars
[solanum.git] / ircd / client.c
index 9cc059f8ce05895ef7b190afd9cd16a74634a70e..a11873991a2f40d98b043b7a71a67429f2e49aac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  charybdis: an advanced ircd.
+ *  Solanum: a slightly advanced ircd
  *  client.c: Controls clients.
  *
  *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
@@ -602,13 +602,15 @@ check_one_kline(struct ConfItem *kline)
                /* match one kline */
                switch (masktype) {
                case HM_IPV4:
-                       if (client_p->localClient->ip.ss_family == AF_INET6 &&
+               case HM_IPV6:
+                       if (IsConfDoSpoofIp(client_p->localClient->att_conf) &&
+                                       IsConfKlineSpoof(client_p->localClient->att_conf))
+                               continue;
+                       if (client_p->localClient->ip.ss_family == AF_INET6 && sockaddr.ss_family == AF_INET &&
                                        rb_ipv4_from_ipv6((struct sockaddr_in6 *)&client_p->localClient->ip, &ip4)
                                                && comp_with_mask_sock((struct sockaddr *)&ip4, (struct sockaddr *)&sockaddr, bits))
                                matched = 1;
-                       /* fallthrough */
-               case HM_IPV6:
-                       if (client_p->localClient->ip.ss_family == sockaddr.ss_family &&
+                       else if (client_p->localClient->ip.ss_family == sockaddr.ss_family &&
                                        comp_with_mask_sock((struct sockaddr *)&client_p->localClient->ip,
                                                (struct sockaddr *)&sockaddr, bits))
                                matched = 1;
@@ -616,6 +618,9 @@ check_one_kline(struct ConfItem *kline)
                case HM_HOST:
                        if (match(kline->host, client_p->orighost))
                                matched = 1;
+                       if (IsConfDoSpoofIp(client_p->localClient->att_conf) &&
+                                       IsConfKlineSpoof(client_p->localClient->att_conf))
+                               continue;
                        if (match(kline->host, client_p->sockhost))
                                matched = 1;
                        break;
@@ -1142,7 +1147,7 @@ free_exited_clients(void *unused)
                                                target_p->name, (unsigned int) target_p->status,
                                                (unsigned long long)target_p->flags,  target_p->handler);
                                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                               "Please report this to the charybdis developers!");
+                                               "Please report this to the solanum developers!");
                                        found++;
                                }
                        }
@@ -1286,7 +1291,7 @@ exit_aborted_clients(void *unused)
                                        abt->client->name, (unsigned int) abt->client->status,
                                        (unsigned long long)abt->client->flags, abt->client->handler);
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                       "Please report this to the charybdis developers!");
+                                       "Please report this to the solanum developers!");
                                continue;
                        }
                }
@@ -1828,11 +1833,11 @@ show_ip(struct Client *source_p, struct Client *target_p)
                 * to local opers.
                 */
                if(!ConfigFileEntry.hide_spoof_ips &&
-                  (source_p == NULL || MyOper(source_p)))
+                  (source_p == NULL || (MyConnect(source_p) && HasPrivilege(source_p, "auspex:hostname"))))
                        return 1;
                return 0;
        }
-       else if(IsDynSpoof(target_p) && (source_p != NULL && !IsOper(source_p)))
+       else if(IsDynSpoof(target_p) && (source_p != NULL && !HasPrivilege(source_p, "auspex:hostname")))
                return 0;
        else
                return 1;