]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/blacklist.c
Unbreak /quote help stats as an oper (all where oper and user help are different).
[irc/rqf/shadowircd.git] / src / blacklist.c
index 5054dfa7f791896fb0b8f225d64cba6d49d88b7e..766807f057fbea53869605dca60f59b0b6f615c5 100644 (file)
@@ -2,7 +2,7 @@
  * charybdis: A slightly useful ircd.
  * blacklist.c: Manages DNS blacklist entries and lookups
  *
- * Copyright (C) 2006 charybdis development team
+ * Copyright (C) 2006-2008 charybdis development team
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -81,8 +81,16 @@ static void blacklist_dns_callback(void *vptr, struct DNSReply *reply)
        if (reply != NULL)
        {
                /* only accept 127.0.0.x as a listing */
-               listed = reply->addr.ss_family == AF_INET &&
-                               !memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3);
+               if (reply->addr.ss_family == AF_INET &&
+                               !memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3))
+                       listed = TRUE;
+               else if (blcptr->blacklist->lastwarning + 3600 < CurrentTime)
+               {
+                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                                       "Garbage reply from blacklist %s",
+                                       blcptr->blacklist->host);
+                       blcptr->blacklist->lastwarning = CurrentTime;
+               }
        }
 
        /* they have a blacklist entry for this client */
@@ -150,6 +158,7 @@ struct Blacklist *new_blacklist(char *name, char *reject_reason)
                blptr->status &= ~CONF_ILLEGAL;
        strlcpy(blptr->host, name, HOSTLEN);
        strlcpy(blptr->reject_reason, reject_reason, IRCD_BUFSIZE);
+       blptr->lastwarning = 0;
 
        return blptr;
 }