Never count servers in IPcheck.
authorMichael Poole <mdpoole@troilus.org>
Tue, 28 Jun 2005 00:42:06 +0000 (00:42 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 28 Jun 2005 00:42:06 +0000 (00:42 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1438 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_bsd.c
ircd/s_serv.c

index 1d42b8d4a785fe6477fa70b3111d62978c708f86..6050fd2957734c9bebb03c930641d25a1982490b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-06-27  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/s_bsd.c (add_connection): Split logic for server versus
+       client listeners; only do IPcheck for client connections.
+
+       * ircd/s_serv.c (server_estab): There is no longer a need to
+       remove IPcheck reference, so don't.
+
 2005-06-27  Michael Poole <mdpoole@troilus.org>
 
        * include/client.h (struct Connection): Remove con_dns_reply (and
index 27cdf30c8f6094cf0e4668fc4eb1ec8cdf93652e..2a57382856f66d4030e6eedfc7fe67c96906602c 100644 (file)
@@ -518,27 +518,32 @@ void add_connection(struct Listener* listener, int fd) {
    */
   os_disable_options(fd);
 
-  /*
-   * Add this local client to the IPcheck registry.
-   *
-   * If they're throttled, murder them, but tell them why first.
-   */
-  if (!IPcheck_local_connect(&addr.addr, &next_target) && !listener->server)
+  if (listener->server)
   {
-    ++ServerStats->is_ref;
-    write(fd, throttle_message, strlen(throttle_message));
-    close(fd);
-    return;
+    new_client = make_client(0, STAT_UNKNOWN_SERVER);
+  }
+  else
+  {
+    /*
+     * Add this local client to the IPcheck registry.
+     *
+     * If they're throttled, murder them, but tell them why first.
+     */
+    if (!IPcheck_local_connect(&addr.addr, &next_target))
+    {
+      ++ServerStats->is_ref;
+      write(fd, throttle_message, strlen(throttle_message));
+      close(fd);
+      return;
+    }
+    new_client = make_client(0, STAT_UNKNOWN_USER);
+    SetIPChecked(new_client);
   }
-
-  new_client = make_client(0, ((listener->server) ?
-                               STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER));
 
   /*
    * Copy ascii address to 'sockhost' just in case. Then we have something
    * valid to put into error messages...
    */
-  SetIPChecked(new_client);
   ircd_ntoa_r(cli_sock_ip(new_client), &addr.addr);
   strcpy(cli_sockhost(new_client), cli_sock_ip(new_client));
   memcpy(&cli_ip(new_client), &addr.addr, sizeof(cli_ip(new_client)));
index bc09198f80a813777e647c5cd4d34e9e581b81ca..abcf6aa55b66825e333e7f8c26fa9c7368d1807f 100644 (file)
@@ -133,12 +133,6 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf)
                  cli_serv(cptr)->timestamp, MAJOR_PROTOCOL, NumServCap(&me),
                  feature_bool(FEAT_HUB) ? "h" : "",
                  *(cli_info(&me)) ? cli_info(&me) : "IRCers United");
-    /*
-     * Don't charge this IP# for connecting
-     * XXX - if this comes from a server port, it will not have been added
-     * to the IP check registry, see add_connection in s_bsd.c
-     */
-    IPcheck_connect_fail(cptr);
   }
 
   det_confs_butmask(cptr, CONF_SERVER | CONF_UWORLD);