* 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
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 */
blptr->status &= ~CONF_ILLEGAL;
strlcpy(blptr->host, name, HOSTLEN);
strlcpy(blptr->reject_reason, reject_reason, IRCD_BUFSIZE);
+ blptr->lastwarning = 0;
return blptr;
}