git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1051
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
+2004-05-15 hikari <shadow@undernet.org>
+
+ [Original ChangeLog date: 2003-07-13 -MDP]
+
+ * ircd/IPcheck.c: Fixed (another) overflow problem in
+ ip_registry_check_local()
+
+ [Original ChangeLog date: 2003-06-29 -MDP]
+
+ * ircd/IPcheck.c: Fixed overflow problem in
+ ip_registry_connect_fail()
+
+2004-05-15 Isomer <isomer@undernet.org>
+
+ [Original ChangeLog date: 2003-05-02 -MDP]
+
+ * ircd/IPcheck.c: Added assert()'s to check for underflow
+
2004-05-15 Kevin L Mitchell <klmitch@mit.edu>
[Original ChangeLog date: 2003-11-22 -MDP]
2004-05-15 Kevin L Mitchell <klmitch@mit.edu>
[Original ChangeLog date: 2003-11-22 -MDP]
* Don't allow more then 255 connects from one IP number, ever
*/
if (0 == ++entry->connected)
* Don't allow more then 255 connects from one IP number, ever
*/
if (0 == ++entry->connected)
+ {
+ entry->connected--;
if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
entry->attempts = 0;
if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
entry->attempts = 0;
#ifdef NOTHROTTLE
return 1;
#else
#ifdef NOTHROTTLE
return 1;
#else
+ assert(entry->connected > 0);
--entry->connected;
return 0;
#endif
--entry->connected;
return 0;
#endif
{
struct IPRegistryEntry* entry = ip_registry_find(addr);
if (entry)
{
struct IPRegistryEntry* entry = ip_registry_find(addr);
if (entry)
+ {
+ if (0 == --entry->attempts)
+ ++entry->attempts;
+ }
/*
* If this was the last one, set `last_connect' to disconnect time (used for expiration)
*/
/*
* If this was the last one, set `last_connect' to disconnect time (used for expiration)
*/
+ /* assert(entry->connected > 0); */
if (0 == --entry->connected) {
if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) {
/*
if (0 == --entry->connected) {
if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) {
/*