git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1292
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
+2005-01-03 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/IPcheck.c (ip_registry_check_remote): Do not count clones
+ that have an invalid IP address.
+
+ * ircd/ircd.c (try_connections): Update Connect hold time before
+ skipping it, to prevent infinite loops.
+
2005-01-03 Kevin L Mitchell <klmitch@mit.edu>
* ircd/s_user.c (is_silenced): is_silenced() would core if sptr
2005-01-03 Kevin L Mitchell <klmitch@mit.edu>
* ircd/s_user.c (is_silenced): is_silenced() would core if sptr
*/
int ip_registry_check_remote(struct Client* cptr, int is_burst)
{
*/
int ip_registry_check_remote(struct Client* cptr, int is_burst)
{
- struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr));
+ struct IPRegistryEntry* entry;
/*
* Mark that we did add/update an IPregistry entry
*/
SetIPChecked(cptr);
/*
* Mark that we did add/update an IPregistry entry
*/
SetIPChecked(cptr);
+ if (!irc_in_addr_valid(&cli_ip(cptr)))
+ return 1;
+ entry = ip_registry_find(&cli_ip(cptr));
if (0 == entry) {
entry = ip_registry_new_entry();
ip_registry_canonicalize(&entry->addr, &cli_ip(cptr));
if (0 == entry) {
entry = ip_registry_new_entry();
ip_registry_canonicalize(&entry->addr, &cli_ip(cptr));
if (next > aconf->hold || next == 0)
next = aconf->hold;
if (next > aconf->hold || next == 0)
next = aconf->hold;
- /* Skip this entry if its use is still on hold until future, too
- * many links in its connection class, it is already linked, or if
- * connect rules forbid a link now.
- */
+ /* Update the next time we can consider this entry. */
cltmp = aconf->conn_class;
cltmp = aconf->conn_class;
+ aconf->hold = ConFreq(cltmp) ? CurrentTime + ConFreq(cltmp) : 0;
+
+ /* Do not try to connect if its use is still on hold until future,
+ * too many links in its connection class, it is already linked,
+ * or if connect rules forbid a link now.
+ */
if ((aconf->hold > CurrentTime)
|| (Links(cltmp) >= MaxLinks(cltmp))
|| FindServer(aconf->name)
|| conf_eval_crule(aconf->name, CRULE_MASK))
continue;
if ((aconf->hold > CurrentTime)
|| (Links(cltmp) >= MaxLinks(cltmp))
|| FindServer(aconf->name)
|| conf_eval_crule(aconf->name, CRULE_MASK))
continue;
- /* We want to connect; update entry's hold time. */
- aconf->hold = ConFreq(cltmp) ? CurrentTime + ConFreq(cltmp) : 0;
-
/* Ensure it is at the end of the list for future checks. */
if (aconf->next) {
/* Find aconf's location in the list and splice it out. */
/* Ensure it is at the end of the list for future checks. */
if (aconf->next) {
/* Find aconf's location in the list and splice it out. */