Author: Bleep <helveytw@home.com>
authorBleep <twhelvey1@home.com>
Sun, 17 Sep 2000 06:49:55 +0000 (06:49 +0000)
committerBleep <twhelvey1@home.com>
Sun, 17 Sep 2000 06:49:55 +0000 (06:49 +0000)
Log message: Merge in changes from .10 pl 12, fixup merge conflicts,
temporarily back out IPcheck changes to get bug fixes from .10.
Build and test, remake dependencies.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@291 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

24 files changed:
ChangeLog
ChangeLog.10
config/config-sh.in
doc/example.conf
include/IPcheck.h
include/msg.h
ircd/IPcheck.c
ircd/Makefile.in
ircd/channel.c
ircd/ircd.c
ircd/ircd_string.c
ircd/list.c
ircd/m_names.c
ircd/m_nick.c
ircd/numnicks.c
ircd/parse.c
ircd/s_auth.c
ircd/s_bsd.c
ircd/s_conf.c
ircd/s_misc.c
ircd/s_serv.c
ircd/s_user.c
ircd/table_gen.c
ircd/uping.c

index 2d2a5b87c76f36b9eca8aa875eb9b0401a355656..5c3942c8c750673355c8223ba3703d5b86d8746b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-09-17  Thomas Helvey <helveytw@home.com>
+       * ircd/*.c: merged in changes from 2.10.10.pl12, cleanup
+       merge conflicts.
+       * ircd/*.h: merged in changes from 2.10.10.pl12, cleanup
+       merge conflicts
+
 2000-09-16  Thomas Helvey <helveytw@home.com>
        * ircd/s_conf.c: add code for server struct
        * ircd/client.c: copy of class.c sort of, new file for client
 * Merge in u2_10_10_beta06 changes --Bleep
 * Start ircu2.10.11 development, beta branch u2_10_10 --Bleep
 #-----------------------------------------------------------------------------
-#
-# ChangeLog for ircu2.10.11
-#
-# $Id: ChangeLog,v 1.164 2000-09-17 03:41:37 bleep Exp $
-#
-# Insert new changes at beginning of the change list.
-#
index 2b08206338eeab4884134b9a40147967ac59764f..73ae3b3ac0dd4abea03fa00b9954e6e4a8aa8f2f 100644 (file)
@@ -1,10 +1,53 @@
 #
 # ChangeLog for ircu2.10.10
 #
-# $Id: ChangeLog.10,v 1.7 2000-03-28 06:40:56 bleep Exp $
 #
 # Insert new changes at beginning of the change list.
 #
+--------------------------- Released 2.10.10.pl11.(release)
+* Fixed G-lined (reason), thanks to dfx -- Isomer
+* Added reason to the "G-lined (reason)" quit messages. -- Isomer
+* Removed 'for nick[1.2.3.4]' from quit messages, they're redundant
+  and make hub hiding more reliable --Isomer
+* ircd/s_user.c (hunt_server): add 'No such server' message back 
+  --Isomer
+* ircd/s_bsd.c: remove ALWAYSFLUSH - the problem wasn't ircu's fault 
+  -- Isomer
+* ircd/m_names.c (m_names): don't add a space if the user's a
+  zombie; fixes an overrun where we generate a huge number of spaces
+  in the names reply without length-checking them properly -- Kev
+* added 'ALWAYSFLUSH', if you thought the furgeson flusher was bad...
+  --Isomer
+* Fixed /USERHOST again.  Horribly embarrased.  Thanks again Liandrin 
+  --Isomer
+* Added extra field to /stats Y showing how many people are in that class.
+  Information was previously available via /trace, however tended to flood
+  you off if you weren't on a good connection.  Requested by Mr_RIP
+  -- Isomer
+* Fixed 'BADCHAN' resetting itself to 'Y', reported by Gator --Isomer
+--------------------------- Released 2.10.10.pl10
+* Released 2.10.10.pl10
+* Backported /names optimisation from 2.10.11.
+  '/names 0' now returns verbose listing, '/names' simply returns
+  ENDOFNAMES. Disallow harmfull /names usage. --Gte
+* Fixed ERR_NOSUCHNICK bug in userhost, thanks to Liandrin --Isomer
+* Conceal more bugs in IPcheck --Isomer
+* Add 'POST' as a unregistered command to disconnect people abusing web
+  proxies --Isomer.
+* Conceal bugs in IPcheck --Isomer
+* Fix for changing the wrong define --Isomer
+* Fix for the easter buggy. --Isomer
+* Fix for rpong --Run
+* Fix for other IPcheck bug, thanks BLMet. --Bleep
+* Fix for IPcheck bug, rewrite IPcheck from scratch (mostly),
+  add changes for new code to s_user.c, ircd.c --Bleep
+* Shorten connection timeout for auth queries to 60 seconds
+  If connection is from localhost use the server alias for the
+  client host. --Bleep
+* Fix for ident bug --Isomer
+* Fix for rping/rpong --Gte
+* Add m_pong to parser handler --Bleep
+* Fix for EXTENDED_NUMERICS bug doh!!! --Bleep
 * Fix for Max Undernet Server bug --Bleep
 * Fix for PRIVMSG<->NOTICE translation from hubs --Bleep
 * Fix for Bogus protocol strings for P9 servers --Bleep
index 1c26420b5d3b5dc31e9b787d1e755c7b686f0dab..12444d8eaf77e9a73ad1748dffd532c2210022bb 100644 (file)
@@ -233,7 +233,6 @@ comment 'Logging (filenames are either full paths or files within DPATH)'
     fi
 
 comment 'Bad Channel G-Lines allow operators to add channel masks to a list which prohibits local clients from being able joining channels which match the mask.  Remote BadChan Glines allow Uworld to add or remove channels from the servers internal list of badchans'
-  BADCHAN=y
   bool 'Do you want to enable Bad Channel G-lines' BADCHAN y
     if [ "$BADCHAN" = "y" ]; then
       echo " "
index 7c1be7659e781c65bbad81cd1db41f4322b8f75d..72f1a4908ed60f603793fd0b8c4f591fedbe3d33 100644 (file)
@@ -215,8 +215,8 @@ T:*.london.ac.uk:london.motd
 # it is not allowed to jupe others as well.
 
 U:Uworld.EU.undernet.org:EuWorld,E,protocol,StatServ,NoteServ,Undernet:*
-U:Uworld2.undernet.org:UWorld2,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:*
-U:Uworld.undernet.org:Uworld,X,W,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:*
+U:Uworld2.undernet.org:UWorld2,W,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:*
+U:Uworld.undernet.org:Uworld,X,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:*
 
 #
 # While running your server, you will most probably encounter individuals
index 0c7f23fe50d9258246383cbfdc31db37c1ecfc50..a81747ce77fe4d6337a6c6a333ef39e345eea5ad 100644 (file)
 #include <sys/types.h>          /* time_t, size_t */
 #define INCLUDED_sys_types_h
 #endif
+#ifndef INCLUDED_netinet_in_h
+#include <netinet/in.h>         /* in_addr */
+#define INCLUDED_netinet_in_h
+#endif
 
 struct Client;
 
-/*----------------------------------------------------------------------------
+/*
  * Prototypes
- *--------------------------------------------------------------------------*/
-extern void ip_registry_expire(void);
-extern int  ip_registry_check_local(unsigned int addr, time_t* next_target_out);
-extern void ip_registry_add_local(unsigned int addr);
-extern int  ip_registry_remote_connect(struct Client *cptr);
-extern void ip_registry_connect_succeeded(struct Client *cptr);
-extern void ip_registry_local_disconnect(struct Client *cptr);
-extern void ip_registry_remote_disconnect(struct Client *cptr);
-extern void ip_registry_connect_succeeded(struct Client *cptr);
-extern int ip_registry_count(unsigned int addr);
+ */
+extern int IPcheck_local_connect(struct in_addr ip, time_t* next_target_out);
+extern void IPcheck_connect_fail(struct in_addr ip);
+extern void IPcheck_connect_succeeded(struct Client *cptr);
+extern int IPcheck_remote_connect(struct Client *cptr, int is_burst);
+extern void IPcheck_disconnect(struct Client *cptr);
+extern unsigned short IPcheck_nr(struct Client* cptr);
+extern void IPcheck_expire();
 
 #endif /* INCLUDED_ipcheck_h */
index 09c86dba5c6b3f807a9039cd8ba2d5d0bdd94c16..df16388ad458b501a549032e1b775565f4619f84 100644 (file)
@@ -322,6 +322,9 @@ struct Client;
 #define TOK_CLEARMODE           "CM"
 #define CMD_CLEARMODE          MSG_CLEARMODE, TOK_CLEARMODE
 
+#define MSG_POST                "POST"          /* POST */
+#define TOK_POST                "POST"
+
 /*
  * Constants
  */
index f867f745d9a86b1cdc24f2e1433deb38eb06e574..6c58f462c5534be83dc0bd552ba7e4a28d03b5cd 100644 (file)
  *
  * $Id$
  *
+ * 
+ * This file should be edited in a window with a width of 141 characters
+ * ick
  */
 #include "IPcheck.h"
 #include "client.h"
 #include "ircd.h"
-#include "numnicks.h"
+#include "numnicks.h"       /* NumNick, NumServ (GODMODE) */
 #include "ircd_alloc.h"
-#include "msg.h"
-#include "s_bsd.h"
-#include "s_debug.h"
-#include "s_user.h"
+#include "s_bsd.h"          /* SetIPChecked */
+#include "s_debug.h"        /* Debug */
+#include "s_user.h"         /* TARGET_DELAY */
 #include "send.h"
 
 #include <assert.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <string.h>
-
-#if 0
-#warning Nick collisions are horribly broken in
-#warning this version, and its known to core on
-#warning a whim.  If your even concidering
-#warning running this on something resembling a
-#warning production network, dont bother, its
-#warning not worth your time.  To those of you
-#warning who grabbed the latest CVS version to
-#warning bug test it, thanks, but I recommend
-#warning you stick to previous versions for the
-#warning time being.
-#error --- Broken code ---
-#endif
+
 
 struct IPTargetEntry {
   int           count;
@@ -55,100 +41,64 @@ struct IPTargetEntry {
 };
 
 struct IPRegistryEntry {
-  struct IPRegistryEntry *next;
-  struct IPTargetEntry   *target;
+  struct IPRegistryEntry*  next;
+  struct IPTargetEntry*    target;
   unsigned int             addr;
-  time_t                  last_connect;
-  unsigned char            connected;
+  int                     last_connect;
+  unsigned short           connected;
   unsigned char            attempts;
 };
 
-
 /*
  * Hash table for IPv4 address registry
  *
  * Hash table size must be a power of 2
  * Use 64K hash table to conserve memory
  */
-/*----------------------------------------------------------------------------
- * Compile-time Configuration
- *--------------------------------------------------------------------------*/
 #define IP_REGISTRY_TABLE_SIZE 0x10000
 #define MASK_16                0xffff
 
-/* We allow 6 connections in 60 seconds */
-#define IPCHECK_CLONE_LIMIT 6
-#define IPCHECK_CLONE_PERIOD 60
-#define IPCHECK_CLONE_DELAY  600
-
-
-/*----------------------------------------------------------------------------
- * Handy Macros
- *--------------------------------------------------------------------------*/
-#define NOW (CurrentTime)
-#define CONNECTED_SINCE(x) (NOW - (x->last_connect))
+#define NOW ((unsigned short)(CurrentTime & MASK_16))
+#define CONNECTED_SINCE(x) (NOW - (x))
 
+#define IPCHECK_CLONE_LIMIT 4
+#define IPCHECK_CLONE_PERIOD 40
+#define IPCHECK_CLONE_DELAY 600
 
-/*----------------------------------------------------------------------------
- * Global Data (ugly!)
- *--------------------------------------------------------------------------*/
-static struct IPRegistryEntry *hashTable[IP_REGISTRY_TABLE_SIZE];
-static struct IPRegistryEntry *freeList = 0;
 
+static struct IPRegistryEntry* hashTable[IP_REGISTRY_TABLE_SIZE];
+static struct IPRegistryEntry* freeList = 0;
 
-/*----------------------------------------------------------------------------
- * ip_registry_hash:  Create a hash key for an IP registry entry and return
- *                    the value.  (Is unsigned int really a good type to give
- *                    to the IP argument?  Ugly.  This should probably be a
- *                    struct in_addr.  This is asking for trouble.  --ZS)
- *--------------------------------------------------------------------------*/
 static unsigned int ip_registry_hash(unsigned int ip)
 {
   return ((ip >> 16) ^ ip) & (IP_REGISTRY_TABLE_SIZE - 1);
 }
 
-
-/*----------------------------------------------------------------------------
- * ip_registry_find:  Find a given IP registry entry and return it.
- *--------------------------------------------------------------------------*/
-static struct IPRegistryEntry *ip_registry_find(unsigned int ip) 
+static struct IPRegistryEntry* ip_registry_find(unsigned int ip)
 {
-  struct IPRegistryEntry *entry = 0;
-
-  for (entry = hashTable[ip_registry_hash(ip)]; entry; entry = entry->next) {
+  struct IPRegistryEntry* entry = hashTable[ip_registry_hash(ip)];
+  for ( ; entry; entry = entry->next) {
     if (entry->addr == ip)
-      return entry;
+      break;
   }
-
-  return NULL;
+  return entry;
 }
 
-
-/*----------------------------------------------------------------------------
- * ip_registry_add:  Add an entry to the IP registry
- *--------------------------------------------------------------------------*/
-static void ip_registry_add(struct IPRegistryEntry *entry) 
+static void ip_registry_add(struct IPRegistryEntry* entry)
 {
   unsigned int bucket = ip_registry_hash(entry->addr);
-
   entry->next = hashTable[bucket];
   hashTable[bucket] = entry;
 }
   
-
-/*----------------------------------------------------------------------------
- * ip_registry_remove:  Remove an entry from the IP registry
- *--------------------------------------------------------------------------*/
-static void ip_registry_remove(struct IPRegistryEntry* entry) 
+static void ip_registry_remove(struct IPRegistryEntry* entry)
 {
   unsigned int bucket = ip_registry_hash(entry->addr);
-
   if (hashTable[bucket] == entry)
     hashTable[bucket] = entry->next;
   else {
-    struct IPRegistryEntry *prev;
-
-    for (prev = hashTable[bucket]; prev; prev = prev->next) {
+    struct IPRegistryEntry* prev = hashTable[bucket];
+    for ( ; prev; prev = prev->next) {
       if (prev->next == entry) {
         prev->next = entry->next;
         break;
@@ -157,108 +107,73 @@ static void ip_registry_remove(struct IPRegistryEntry* entry)
   }
 }
  
-
-/*----------------------------------------------------------------------------
- * ip_registry_new_entry():  Creates and initializes an IP Registry entry.
- *                           NOW ALSO ADDS IT TO THE LIST! --ZS
- *--------------------------------------------------------------------------*/
-static struct IPRegistryEntry *ip_registry_new_entry(unsigned int addr, int attempt)
+static struct IPRegistryEntry* ip_registry_new_entry()
 {
   struct IPRegistryEntry* entry = freeList;
-
   if (entry)
     freeList = entry->next;
   else
-    entry = (struct IPRegistryEntry *)MyMalloc(sizeof(struct IPRegistryEntry));
+    entry = (struct IPRegistryEntry*) MyMalloc(sizeof(struct IPRegistryEntry));
 
   assert(0 != entry);
-
   memset(entry, 0, sizeof(struct IPRegistryEntry));
   entry->last_connect = NOW;     /* Seconds since last connect attempt */
   entry->connected    = 1;       /* connected clients for this IP */
-  entry->attempts     = attempt; /* Number attempts for this IP        */
-  entry->addr         = addr;    /* Entry's IP Address                 */
-
-  ip_registry_add(entry);
-
+  entry->attempts     = 1;       /* Number attempts for this IP */
   return entry;
 }
 
-
-/*----------------------------------------------------------------------------
- * ip_registry_delete_entry:  Frees an entry and adds the structure to a list
- *                            of free structures.  (We should probably reclaim
- *                            the freelist every once in a while!  This is
- *                            potentially a way to DoS the server...  -ZS)
- *--------------------------------------------------------------------------*/
-static void ip_registry_delete_entry(struct IPRegistryEntry *entry)
+static void ip_registry_delete_entry(struct IPRegistryEntry* entry)
 {
   if (entry->target)
     MyFree(entry->target);
-
   entry->next = freeList;
   freeList = entry;
 }
 
-
-/*----------------------------------------------------------------------------
- * ip_registry_update_free_targets:  
- *--------------------------------------------------------------------------*/
-static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry  *entry)
+static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry* entry)
 {
   unsigned int free_targets = STARTTARGETS;
 
   if (entry->target) {
-    free_targets = (entry->target->count +
-                   (CONNECTED_SINCE(entry) / TARGET_DELAY));
-
+    free_targets = entry->target->count + (CONNECTED_SINCE(entry->last_connect) / TARGET_DELAY);
     if (free_targets > STARTTARGETS)
       free_targets = STARTTARGETS;
-
     entry->target->count = free_targets;
   }
-
   return free_targets;
 }
 
-
-/*----------------------------------------------------------------------------
- * ip_registry_expire_entry:  expire an IP entry if it needs to be.  If an
- *                            entry isn't expired, then also check the target
- *                            list to see if it needs to be expired.
- *--------------------------------------------------------------------------*/
-static void ip_registry_expire_entry(struct IPRegistryEntry *entry)
+static void ip_registry_expire_entry(struct IPRegistryEntry* entry)
 {
   /*
    * Don't touch this number, it has statistical significance
    * XXX - blah blah blah
-   * ZS - Just -what- statistical significance does it -have-?
-   * Iso - Noone knows, we've just been told not to touch it.
    */
-  if (CONNECTED_SINCE(entry) > 120 && 0 != entry->target) {
-    MyFree(entry->target);
-    entry->target = 0;
-  }
-  if (CONNECTED_SINCE(entry) > 600) {
+  if (CONNECTED_SINCE(entry->last_connect) > 600) {
+    /*
+     * expired
+     */
     ip_registry_remove(entry);
     ip_registry_delete_entry(entry);
   }
+  else if (CONNECTED_SINCE(entry->last_connect) > 120 && 0 != entry->target) {
+    /*
+     * Expire storage of targets
+     */
+    MyFree(entry->target);
+    entry->target = 0;
+  }
 }
 
-
-/*----------------------------------------------------------------------------
- * ip_registry_expire:  Expire all of the needed entries in the hash table
- *--------------------------------------------------------------------------*/
-void ip_registry_expire(void)
+/*
+ * ip_registry_expire
+ */
+static void ip_registry_expire()
 {
-  struct IPRegistryEntry *entry;
-  struct IPRegistryEntry *entry_next;
-  static time_t   next_expire = 0;
   int i;
-
-  /* Only do this if we're ready to */
-  if (next_expire >= CurrentTime)
-    return;
+  struct IPRegistryEntry* entry;
+  struct IPRegistryEntry* entry_next;
 
   for (i = 0; i < IP_REGISTRY_TABLE_SIZE; ++i) {
     for (entry = hashTable[i]; entry; entry = entry_next) {
@@ -267,12 +182,10 @@ void ip_registry_expire(void)
         ip_registry_expire_entry(entry);
     }
   }
-
-  next_expire = CurrentTime + 60;
 }
 
-
-/*----------------------------------------------------------------------------
+/*
+ * IPcheck_local_connect
  *
  * Event:
  *   A new connection was accept()-ed with IP number `cptr->ip.s_addr'.
@@ -285,10 +198,9 @@ void ip_registry_expire(void)
  *
  * Throttling:
  *
- * A connection should be rejected when a connection from the same IP
- * number was received IPCHECK_CLONE_LIMIT times before this connect
- * attempt, with reconnect intervals of IPCHECK_CLONE_PERIOD seconds
- * or less.
+ * A connection should be rejected when a connection from the same IP number was
+ * received IPCHECK_CLONE_LIMIT times before this connect attempt, with
+ * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less.
  *
  * Free target inheritance:
  *
@@ -297,301 +209,356 @@ void ip_registry_expire(void)
  * structure, or left at STARTTARGETS.  This can be done by changing
  * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))',
  * where FREE_TARGETS may range from 0 till STARTTARGETS.
- *--------------------------------------------------------------------------*/
-int ip_registry_check_local(unsigned int addr, time_t *next_target_out)
+ */
+int ip_registry_check_local(unsigned int addr, time_tnext_target_out)
 {
-  struct IPRegistryEntry *entry        = ip_registry_find(addr);
+  struct IPRegistryEntry* entry = ip_registry_find(addr);
   unsigned int free_targets = STARTTARGETS;
  
-  assert(0 != next_target_out);
-
-  /* If they've never connected before, let them on */
   if (0 == entry) {
-    Debug((DEBUG_DEBUG,"IPcheck: Local user allowed - unseen"));
-    entry = ip_registry_new_entry(addr, 1);
+    entry       = ip_registry_new_entry();
+    entry->addr = addr;    /* The IP number of registry entry */
+    ip_registry_add(entry);
     return 1;
   }
-  
-  /* Keep track of how many people have connected */
-  entry->connected++;
-
-  /* Do not allow more than 250 connects from a single IP, EVER. */
-  if (250 <= entry->connected) {
-    Debug((DEBUG_DEBUG,"IPcheck: Local user disallowed - Too many connections"));
-    entry->connected--;
+  /* Note that this also connects server connects.
+   * It is hard and not interesting, to change that.
+   *
+   * Don't allow more then 255 connects from one IP number, ever
+   */
+  if (0 == ++entry->connected)
     return 0;
-  }
 
-  /* If our threshhold has elapsed, reset the counter so we don't throttle,
-   * IPCHECK_CLONE_LIMIT connections every IPCHECK_CLONE_PERIOD
-   */
-  if (CONNECTED_SINCE(entry) > IPCHECK_CLONE_PERIOD) {
+  if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
     entry->attempts = 0;
-    entry->last_connect = NOW;
-  }
-
-  /* Count the number of recent attempts */ 
-  entry->attempts++;
-  
-  if (250 <= entry->attempts)
-    --entry->attempts;  /* Disallow overflow */
-
 
   free_targets = ip_registry_update_free_targets(entry);
+  entry->last_connect = NOW;
+
+  if (0 == ++entry->attempts)   /* Check for overflow */
+    --entry->attempts;
 
-  /* Have they connected less than IPCHECK_CLONE_LIMIT times && next_target_out */
-  if (entry->attempts < IPCHECK_CLONE_LIMIT && next_target_out) {
+  if (entry->attempts < IPCHECK_CLONE_LIMIT) {
+    if (next_target_out)
       *next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1);
-      entry->last_connect = NOW;
-      Debug((DEBUG_DEBUG,"IPcheck: Local user allowed"));
-      return 1;
   }
-  
-  /* If the server is younger than IPCHECK_CLONE_DELAY then the person
-   * is allowed on.
-   */
-  if ((CurrentTime - me.since) < IPCHECK_CLONE_DELAY) {
-    Debug((DEBUG_DEBUG,"IPcheck: Local user allowed during server startup"));
+  else if ((CurrentTime - me.since) > IPCHECK_CLONE_DELAY) {
+    /* 
+     * Don't refuse connection when we just rebooted the server
+     */
+#ifdef NOTHROTTLE 
     return 1;
+#else
+    --entry->connected;
+    return 0;
+#endif        
   }
-  
-  /* Otherwise they're throttled */
-  entry->connected--;
-  Debug((DEBUG_DEBUG,"IPcheck: Throttling local user"));
-  return 0;
+  return 1;
 }
 
 /*
- * Add someone to the ip registry without throttling them.
- * This is used for server connections.
+ * IPcheck_remote_connect
+ *
+ * Event:
+ *   A remote client connected to Undernet, with IP number `cptr->ip.s_addr'
+ *   and hostname `hostname'.
+ *
+ * Action:
+ *   Update the IPcheck registry.
+ *   Return 0 on failure, 1 on success.
  */
-void ip_registry_add_local(unsigned int addr)
+int ip_registry_check_remote(struct Client* cptr, int is_burst)
 {
-  struct IPRegistryEntry *entry        = ip_registry_find(addr);
-  /* If they've never connected before, let them on */
+  struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr);
+
+  /*
+   * Mark that we did add/update an IPregistry entry
+   */
+  SetIPChecked(cptr);
   if (0 == entry) {
-    Debug((DEBUG_DEBUG,"IPcheck: Local user allowed - unseen"));
-    entry = ip_registry_new_entry(addr, 1);
-    return;
+    entry = ip_registry_new_entry();
+    entry->addr = cptr->ip.s_addr;
+    if (is_burst)
+      entry->attempts = 0;
+    ip_registry_add(entry);
   }
-  
-  /* Keep track of how many people have connected */
-  entry->connected++;
-
-  assert(250 <= entry->connected);
-
-  return;
+  else {
+    if (0 == ++entry->connected) {
+      /* 
+       * Don't allow more then 255 connects from one IP number, ever
+       */
+      return 0;
+    }
+    if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
+      entry->attempts = 0;
+    if (!is_burst) {
+      if (0 == ++entry->attempts) {
+        /*
+         * Check for overflow
+         */
+        --entry->attempts;
+      }
+      ip_registry_update_free_targets(entry);
+      entry->last_connect = NOW;
+    }
+  }
+  return 1;
 }
 
-/*----------------------------------------------------------------------------
- * ip_registry_remote_connect
+/*
+ * IPcheck_connect_fail
  *
- * Does anything that needs to be done once we actually have a client
- * structure to play with on a remote connection.
- * returns:
- *  1 - allowed to connect
- *  0 - disallowed.
- *--------------------------------------------------------------------------*/
-int ip_registry_remote_connect(struct Client *cptr)
+ * Event:
+ *   This local client failed to connect due to legal reasons.
+ *
+ * Action:
+ *   Neutralize the effect of calling IPcheck_local_connect, in such
+ *   a way that the client won't be penalized when trying to reconnect
+ *   again.
+ */
+void ip_registry_connect_fail(unsigned int addr)
 {
-  struct IPRegistryEntry *entry        = ip_registry_find(cptr->ip.s_addr);
-  assert(0 != cptr);
-
-  /* If they've never connected before, let them on */
-  if (0 == entry) {
-    entry = ip_registry_new_entry(cptr->ip.s_addr, 1);
-    SetIPChecked(cptr);
-    Debug((DEBUG_DEBUG,"IPcheck: First remote connection.  connected=%i",entry->connected));
-    return 1;
-  }
-  
-  /* Keep track of how many people have connected */
-  entry->connected++;
-  SetIPChecked(cptr);
-
-  /* Do not allow more than 250 connections from one IP.
-   * This can happen by having 128 clients on one server, and 128 on another
-   * and then the servers joining after a netsplit
-   */ 
-  if (250 <= entry->connected) {
-    sendto_ops("IPcheck Ghost! [%s]",inet_ntoa(cptr->ip));
-    Debug((DEBUG_DEBUG,"IPcheck: Too many connected from IP: %i",entry->connected));
-    return 0;
-  }
-  
-  Debug((DEBUG_DEBUG,"IPcheck: %i people connected",entry->connected));
-  
-  /* They are allowed to connect */
-  return 1;
+  struct IPRegistryEntry* entry = ip_registry_find(addr);
+  if (entry)
+    --entry->attempts;
 }
 
-/*----------------------------------------------------------------------------
+/*
  * IPcheck_connect_succeeded
  *
  * Event:
  *   A client succeeded to finish the registration.
  *
  * Finish IPcheck registration of a successfully, locally connected client.
- *--------------------------------------------------------------------------*/
+ */
 void ip_registry_connect_succeeded(struct Client *cptr)
 {
+  const char*             tr    = "";
   unsigned int free_targets     = STARTTARGETS;
-  struct IPRegistryEntry *entry;
-
-  assert(cptr);
-
-  entry = ip_registry_find(cptr->ip.s_addr);
-
-
-  assert(entry);
+  struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr);
 
+  if (!entry) {
+    Debug((DEBUG_ERROR, "Missing registry entry for: %s", cptr->sock_ip));
+    return;
+  }
   if (entry->target) {
     memcpy(cptr->targets, entry->target->targets, MAXTARGETS);
     free_targets = entry->target->count;
+    tr = " tr";
   }
-
-  sendcmdto_one(&me, CMD_NOTICE, cptr, "%C :connected %u attempts %u/%u free targets %u/%u%s"
-               " IPcheck: %s",
-               cptr, entry->connected, entry->attempts, IPCHECK_CLONE_LIMIT,
-               free_targets, STARTTARGETS, 
-               ((entry->target) ? " [Inherited Targets]" : ""), 
-               ((CurrentTime - me.since) < IPCHECK_CLONE_DELAY) ? "Disabled" : "Enabled");
-               
-  SetIPChecked(cptr);
+  sendto_one(cptr, ":%s NOTICE %s :on %u ca %u(%u) ft %u(%u)%s",
+             me.name, cptr->name, entry->connected, entry->attempts,
+             IPCHECK_CLONE_LIMIT, free_targets, STARTTARGETS, tr);
 }
 
-
-/*----------------------------------------------------------------------------
+/*
  * IPcheck_disconnect
  *
  * Event:
- *   A local client disconnected.
+ *   A local client disconnected or a remote client left Undernet.
  *
  * Action:
  *   Update the IPcheck registry.
  *   Remove all expired IPregistry structures from the hash bucket
  *     that belongs to this clients IP number.
- *--------------------------------------------------------------------------*/
-void ip_registry_local_disconnect(struct Client *cptr)
+ */
+void ip_registry_disconnect(struct Client *cptr)
 {
-  struct IPRegistryEntry *entry;
-  unsigned int free_targets;
-
-  assert(0 != cptr);
-
-  entry = ip_registry_find(cptr->ip.s_addr);
-
-  Debug((DEBUG_DEBUG,"IPcheck: Local Disconnect"));
-       
-  assert(IsIPChecked(cptr));
-  
-  assert(entry);
-
-  assert(entry->connected > 0);
-  
-  if (entry->connected > 0) {
-    entry->connected--;
+  struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr);
+  if (0 == entry) {
+    /*
+     * trying to find an entry for a server causes this to happen,
+     * servers should never have FLAGS_IPCHECK set
+     */
+    return;
   }
-
   /*
-   * If this was the last one, set `last_connect' to disconnect time
-   * (used for expiration)   Note that we reset attempts here as well if our
-   * threshhold hasn't been crossed.
+   * If this was the last one, set `last_connect' to disconnect time (used for expiration)
    */
-  if (0 == entry->connected) {
+  if (0 == --entry->connected) {
+    if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) {
+      /*
+       * Otherwise we'd penetalize for this old value if the client reconnects within 20 seconds
+       */
+      entry->attempts = 0;
+    }
     ip_registry_update_free_targets(entry);
     entry->last_connect = NOW;
   }
-  
-  assert(MyConnect(cptr));
-
-  if (0 == entry->target) {
-    entry->target = (struct IPTargetEntry *)MyMalloc(sizeof(struct IPTargetEntry));
+  if (MyConnect(cptr)) {
+    unsigned int free_targets;
+    /*
+     * Copy the clients targets
+     */
+    if (0 == entry->target) {
+      entry->target = (struct IPTargetEntry*) MyMalloc(sizeof(struct IPTargetEntry));
+      entry->target->count = STARTTARGETS;
+    }
     assert(0 != entry->target);
-    entry->target->count = STARTTARGETS;
-  }
-  memcpy(entry->target->targets, cptr->targets, MAXTARGETS);
 
-  /*
-   * This calculation can be pretty unfair towards large multi-user hosts,
-   * but there is "nothing" we can do without also allowing spam bots to
-   * send more messages or by drastically increasing the ammount of memory
-   * used in the IPregistry.
-   *
-   * The problem is that when a client disconnects, leaving no free targets,
-   * then the next client from that IP number has to pay for it (getting no
-   * free targets).  But ALSO the next client, and the next client, and the
-   * next client etc - until another client disconnects that DOES leave free
-   * targets.  The reason for this is that if there are 10 SPAM bots, and
-   * they all disconnect at once, then they ALL should get no free targets
-   * when reconnecting.  We'd need to store an entry per client (instead of
-   * per IP number) to avoid this.  
-   */
-  if (cptr->nexttarget < CurrentTime)
-    free_targets = (CurrentTime - cptr->nexttarget) / TARGET_DELAY + 1;
-  else
-    free_targets = 0;
-
-  /* Add bonus, if you've been connected for more than 10 minutes you
-   * get a free target every TARGET_DELAY seconds.
-   * this is pretty fuzzy, but it will help in some cases. 
-   */
-  if ((CurrentTime - cptr->firsttime) > 600)
-    free_targets += (CurrentTime - cptr->firsttime - 600) / TARGET_DELAY;
+    memcpy(entry->target->targets, cptr->targets, MAXTARGETS);
+    /*
+     * This calculation can be pretty unfair towards large multi-user hosts, but
+     * there is "nothing" we can do without also allowing spam bots to send more
+     * messages or by drastically increasing the ammount of memory used in the IPregistry.
+     *
+     * The problem is that when a client disconnects, leaving no free targets, then
+     * the next client from that IP number has to pay for it (getting no free targets).
+     * But ALSO the next client, and the next client, and the next client etc - until
+     * another client disconnects that DOES leave free targets.  The reason for this
+     * is that if there are 10 SPAM bots, and they all disconnect at once, then they
+     * ALL should get no free targets when reconnecting.  We'd need to store an entry
+     * per client (instead of per IP number) to avoid this.
+     */
+    if (cptr->nexttarget < CurrentTime) {
+        /*
+         * Number of free targets
+         */
+      free_targets = (CurrentTime - cptr->nexttarget) / TARGET_DELAY + 1;
+    }
+    else
+      free_targets = 0;
+    /*
+     * Add bonus, this is pretty fuzzy, but it will help in some cases.
+     */
+    if ((CurrentTime - cptr->firsttime) > 600)
+      /*
+       * Was longer then 10 minutes online?
+       */
+      free_targets += (CurrentTime - cptr->firsttime - 600) / TARGET_DELAY;
+    /*
+     * Finally, store smallest value for Judgement Day
+     */
+    if (free_targets < entry->target->count)
+      entry->target->count = free_targets;
+  }
+}
 
-  /* Finally, store smallest value for Judgement Day */
-  if (free_targets < entry->target->count)
-    entry->target->count = free_targets;
-  
+/*
+ * IPcheck_nr
+ *
+ * Returns number of clients with the same IP number
+ */
+int ip_registry_count(unsigned int addr)
+{
+  struct IPRegistryEntry* entry = ip_registry_find(addr);
+  return (entry) ? entry->connected : 0;
 }
 
-/*----------------------------------------------------------------------------
- * ip_registry_remote_disconnect
+/*
+ * IPcheck_local_connect
  *
  * Event:
- *   A remote client disconnected.
+ *   A new connection was accept()-ed with IP number `cptr->ip.s_addr'.
  *
  * Action:
  *   Update the IPcheck registry.
- *   Remove all expired IPregistry structures from the hash bucket
- *     that belongs to this clients IP number.
- *--------------------------------------------------------------------------*/
-void ip_registry_remote_disconnect(struct Client *cptr)
+ *   Return:
+ *     1 : You're allowed to connect.
+ *     0 : You're not allowed to connect.
+ *
+ * Throttling:
+ *
+ * A connection should be rejected when a connection from the same IP number was
+ * received IPCHECK_CLONE_LIMIT times before this connect attempt, with
+ * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less.
+ *
+ * Free target inheritance:
+ *
+ * When the client is accepted, then the number of Free Targets
+ * of the cptr is set to the value stored in the found IPregistry
+ * structure, or left at STARTTARGETS.  This can be done by changing
+ * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))',
+ * where FREE_TARGETS may range from 0 till STARTTARGETS.
+ */
+int IPcheck_local_connect(struct in_addr a, time_t* next_target_out)
 {
-  struct IPRegistryEntry *entry;
+  assert(0 != next_target_out);
+  return ip_registry_check_local(a.s_addr, next_target_out);
+}
 
+/*
+ * IPcheck_remote_connect
+ *
+ * Event:
+ *   A remote client connected to Undernet, with IP number `cptr->ip.s_addr'
+ *   and hostname `hostname'.
+ *
+ * Action:
+ *   Update the IPcheck registry.
+ *   Return 0 on failure, 1 on success.
+ */
+int IPcheck_remote_connect(struct Client *cptr, int is_burst)
+{
   assert(0 != cptr);
+  return ip_registry_check_remote(cptr, is_burst);
+}
 
-  entry = ip_registry_find(cptr->ip.s_addr);
-  
-  assert(entry);
-  
-  assert(entry->connected > 0);
-  Debug((DEBUG_DEBUG,"IPcheck: Remote Disconnect"));
+/*
+ * IPcheck_connect_fail
+ *
+ * Event:
+ *   This local client failed to connect due to legal reasons.
+ *
+ * Action:
+ *   Neutralize the effect of calling IPcheck_local_connect, in such
+ *   a way that the client won't be penalized when trying to reconnect
+ *   again.
+ */
+void IPcheck_connect_fail(struct in_addr a)
+{
+  ip_registry_connect_fail(a.s_addr);
+}
 
-  if (entry->connected > 0) {
-    entry->connected--;
-  }
+/*
+ * IPcheck_connect_succeeded
+ *
+ * Event:
+ *   A client succeeded to finish the registration.
+ *
+ * Finish IPcheck registration of a successfully, locally connected client.
+ */
+void IPcheck_connect_succeeded(struct Client *cptr)
+{
+  assert(0 != cptr);
+  ip_registry_connect_succeeded(cptr);
+}
 
-  /*
-   * If this was the last one, set `last_connect' to disconnect time
-   * (used for expiration)   Note that we reset attempts here as well if our
-   * threshhold hasn't been crossed.
-   */
-  if (0 == entry->connected) {
-    ip_registry_update_free_targets(entry);
-    entry->last_connect=NOW;
-  }
+/*
+ * IPcheck_disconnect
+ *
+ * Event:
+ *   A local client disconnected or a remote client left Undernet.
+ *
+ * Action:
+ *   Update the IPcheck registry.
+ *   Remove all expired IPregistry structures from the hash bucket
+ *     that belongs to this clients IP number.
+ */
+void IPcheck_disconnect(struct Client *cptr)
+{
+  assert(0 != cptr);
+  ip_registry_disconnect(cptr);
 }
 
-/*----------------------------------------------------------------------------
+/*
  * IPcheck_nr
  *
  * Returns number of clients with the same IP number
- *--------------------------------------------------------------------------*/
-int ip_registry_count(unsigned int addr)
+ */
+unsigned short IPcheck_nr(struct Client *cptr)
 {
-  struct IPRegistryEntry *entry = ip_registry_find(addr);
-  return (entry) ? entry->connected : 0;
+  assert(0 != cptr);
+  return ip_registry_count(cptr->ip.s_addr);
 }
+
+void IPcheck_expire()
+{
+  static time_t next_expire = 0;
+  if (next_expire < CurrentTime) {
+    ip_registry_expire();
+    next_expire = CurrentTime + 60;
+  }
+}
+
+
index 76992b4a5bc585f3ca531de5c3a5d1c7cd2f2465..032d7a5ed163e79d3bb7ace2b92af9faddd8d310 100644 (file)
@@ -67,6 +67,7 @@ SRC = \
        IPcheck.c \
        channel.c \
        class.c \
+       client.c \
        crule.c \
        dbuf.c \
        fda.c \
@@ -286,11 +287,11 @@ stamp-m:
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/numnicks.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/msg.h ../include/s_bsd.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h
+ ../include/fda.h ../include/s_bsd.h ../include/s_debug.h \
+ ../include/s_user.h ../include/send.h
 channel.o: channel.c ../include/channel.h ../config/config.h \
  ../config/setup.h ../include/ircd_defs.h ../include/client.h \
  ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
@@ -303,13 +304,13 @@ channel.o: channel.c ../include/channel.h ../config/config.h \
  ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
  ../include/support.h ../include/sys.h ../include/whowas.h
 class.o: class.c ../include/class.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/list.h \
  ../include/numeric.h ../include/s_conf.h ../include/s_debug.h \
  ../include/send.h
 crule.o: crule.c ../include/crule.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_chattr.h ../include/ircd_string.h ../include/match.h \
@@ -321,20 +322,20 @@ fda.o: fda.c
 fileio.o: fileio.c ../include/fileio.h ../include/ircd_alloc.h \
  ../include/fda.h
 gline.o: gline.c ../include/gline.h ../config/config.h \
- ../config/setup.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+ ../config/setup.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/match.h ../include/numeric.h \
- ../include/s_bsd.h ../include/s_misc.h ../include/send.h \
- ../include/support.h ../include/msg.h ../include/numnicks.h \
- ../include/sys.h
-hash.o: hash.c ../include/hash.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
- ../config/config.h ../config/setup.h ../include/ircd_chattr.h \
- ../include/ircd_string.h ../include/ircd.h ../include/struct.h \
- ../include/msg.h ../include/send.h ../include/support.h \
- ../include/sys.h
+ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/send.h ../include/support.h ../include/msg.h \
+ ../include/numnicks.h ../include/sys.h
+hash.o: hash.c ../include/hash.h ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/channel.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/ircd_string.h ../include/ircd.h \
+ ../include/struct.h ../include/msg.h ../include/send.h \
+ ../include/support.h ../include/sys.h
 ircd.o: ircd.c ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_defs.h ../include/IPcheck.h \
  ../include/class.h ../include/client.h ../include/dbuf.h \
@@ -352,7 +353,7 @@ ircd_alloc.o: ircd_alloc.c ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_string.h ../config/config.h ../config/setup.h \
  ../include/ircd_chattr.h ../include/s_debug.h ../include/ircd_defs.h
 ircd_log.o: ircd_log.c ../include/ircd_log.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../config/config.h ../config/setup.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/s_debug.h ../include/struct.h
 ircd_osdep.o: ircd_osdep.c ../include/ircd_osdep.h
@@ -365,23 +366,23 @@ ircd_relay.o: ircd_relay.c ../include/ircd_relay.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
  ../include/s_misc.h ../include/s_user.h ../include/send.h
 ircd_reply.o: ircd_reply.c ../include/ircd_reply.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_snprintf.h ../include/numeric.h \
  ../include/s_conf.h ../include/s_debug.h ../include/send.h
 ircd_signal.o: ircd_signal.c ../include/ircd_signal.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_defs.h
-ircd_snprintf.o: ircd_snprintf.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
- ../config/config.h ../config/setup.h ../include/ircd_snprintf.h \
- ../include/struct.h
+ircd_snprintf.o: ircd_snprintf.c ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/channel.h ../config/config.h ../config/setup.h \
+ ../include/ircd_snprintf.h ../include/struct.h
 ircd_string.o: ircd_string.c ../include/ircd_string.h \
  ../config/config.h ../config/setup.h ../include/ircd_chattr.h \
- ../include/ircd_defs.h chattr.tab.c
+ ../include/ircd_defs.h ../include/ircd_log.h chattr.tab.c
 ircd_xopen.o: ircd_xopen.c ../include/ircd_xopen.h
 jupe.o: jupe.c ../include/jupe.h ../config/config.h ../config/setup.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
  ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
@@ -390,7 +391,7 @@ jupe.o: jupe.c ../include/jupe.h ../config/config.h ../config/setup.h \
  ../include/s_misc.h ../include/send.h ../include/support.h \
  ../include/sys.h
 list.o: list.c ../include/list.h ../include/class.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
  ../include/ircd_handler.h ../include/ircd.h ../config/config.h \
  ../config/setup.h ../include/struct.h ../include/ircd_alloc.h \
  ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \
@@ -408,12 +409,12 @@ listener.o: listener.c ../include/listener.h ../include/ircd_defs.h \
  ../include/numeric.h ../include/s_bsd.h ../include/s_conf.h \
  ../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \
  ../include/sys.h
-m_admin.o: m_admin.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/s_conf.h ../include/s_user.h
-m_away.o: m_away.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_admin.o: m_admin.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/s_conf.h ../include/s_user.h
+m_away.o: m_away.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
@@ -427,21 +428,21 @@ m_burst.o: m_burst.c ../include/channel.h ../config/config.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_conf.h ../include/s_misc.h ../include/send.h \
  ../include/support.h
-m_clearmode.o: m_clearmode.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
- ../config/config.h ../config/setup.h ../include/hash.h \
- ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/list.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/send.h \
- ../include/support.h
-m_close.o: m_close.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_clearmode.o: m_clearmode.c ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/channel.h ../config/config.h ../config/setup.h \
+ ../include/hash.h ../include/ircd.h ../include/struct.h \
+ ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/send.h ../include/support.h
+m_close.o: m_close.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/numeric.h ../include/s_bsd.h \
  ../include/send.h
-m_connect.o: m_connect.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \
+m_connect.o: m_connect.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/crule.h \
  ../include/hash.h ../include/ircd.h ../config/config.h \
  ../config/setup.h ../include/struct.h ../include/ircd_log.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
@@ -449,10 +450,10 @@ m_connect.o: m_connect.c ../include/client.h ../include/dbuf.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \
  ../include/send.h
-m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/s_user.h
+m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/s_user.h
 m_create.o: m_create.c ../include/channel.h ../config/config.h \
  ../config/setup.h ../include/ircd_defs.h ../include/client.h \
  ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
@@ -460,26 +461,26 @@ m_create.o: m_create.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
  ../include/send.h
-m_defaults.o: m_defaults.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_defaults.o: m_defaults.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/numeric.h ../include/numnicks.h \
  ../include/send.h ../include/supported.h ../include/channel.h \
  ../include/version.h
-m_destruct.o: m_destruct.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_destruct.o: m_destruct.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/send.h
-m_desynch.o: m_desynch.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_desynch.o: m_desynch.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/s_bsd.h ../include/send.h
-m_die.o: m_die.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_die.o: m_die.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
@@ -490,29 +491,29 @@ m_endburst.o: m_endburst.c ../include/channel.h ../config/config.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/send.h
-m_error.o: m_error.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_error.o: m_error.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_debug.h ../include/s_misc.h ../include/send.h
-m_gline.o: m_gline.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/gline.h \
+m_gline.o: m_gline.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/gline.h \
  ../config/config.h ../config/setup.h ../include/hash.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_conf.h ../include/s_misc.h ../include/send.h \
  ../include/support.h
-m_help.o: m_help.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_help.o: m_help.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/send.h
-m_info.o: m_info.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_info.o: m_info.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
@@ -525,8 +526,8 @@ m_invite.o: m_invite.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_user.h ../include/send.h
-m_ison.o: m_ison.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_ison.o: m_ison.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/numeric.h ../include/send.h
@@ -538,8 +539,8 @@ m_join.o: m_join.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \
  ../include/send.h ../include/handlers.h
-m_jupe.o: m_jupe.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/jupe.h \
+m_jupe.o: m_jupe.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/jupe.h \
  ../config/config.h ../config/setup.h ../include/hash.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
@@ -552,15 +553,15 @@ m_kick.o: m_kick.c ../include/channel.h ../config/config.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/send.h
-m_kill.o: m_kill.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_kill.o: m_kill.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_misc.h \
  ../include/send.h ../include/whowas.h
-m_links.o: m_links.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_links.o: m_links.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/match.h ../include/msg.h \
@@ -573,15 +574,15 @@ m_list.o: m_list.c ../include/channel.h ../config/config.h \
  ../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/send.h
-m_lusers.o: m_lusers.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_lusers.o: m_lusers.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/querycmds.h ../include/s_user.h \
  ../include/s_serv.h ../include/send.h
-m_map.o: m_map.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_map.o: m_map.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/map.h ../include/numeric.h \
@@ -594,8 +595,8 @@ m_mode.o: m_mode.c ../include/handlers.h ../include/channel.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/s_conf.h ../include/s_debug.h \
  ../include/s_user.h ../include/send.h
-m_motd.o: m_motd.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_motd.o: m_motd.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/match.h ../include/msg.h \
@@ -609,28 +610,29 @@ m_names.o: m_names.c ../include/channel.h ../config/config.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_user.h \
  ../include/send.h
 m_nick.o: m_nick.c ../include/IPcheck.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/hash.h ../include/ircd.h ../config/config.h \
  ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \
  ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
  ../include/s_misc.h ../include/s_user.h ../include/send.h
-m_notice.o: m_notice.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_chattr.h ../include/ircd_relay.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/match.h ../include/msg.h \
- ../include/numeric.h ../include/send.h ../include/handlers.h
-m_oper.o: m_oper.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_notice.o: m_notice.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_chattr.h \
+ ../include/ircd_relay.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/match.h ../include/msg.h ../include/numeric.h \
+ ../include/send.h ../include/handlers.h
+m_oper.o: m_oper.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h \
  ../include/ircd_xopen.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/querycmds.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h
-m_opmode.o: m_opmode.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
+ ../include/s_debug.h ../include/s_user.h ../include/s_misc.h \
+ ../include/send.h ../include/support.h
+m_opmode.o: m_opmode.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/channel.h \
  ../config/config.h ../config/setup.h ../include/hash.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
@@ -641,30 +643,30 @@ m_part.o: m_part.c ../include/channel.h ../config/config.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h \
  ../include/numeric.h ../include/numnicks.h ../include/send.h
-m_pass.o: m_pass.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/send.h
-m_ping.o: m_ping.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_pass.o: m_pass.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/send.h
+m_ping.o: m_ping.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
  ../config/setup.h ../include/ircd_chattr.h ../include/ircd.h \
  ../include/struct.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/s_debug.h ../include/send.h
-m_pong.o: m_pong.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_pong.o: m_pong.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/s_user.h ../include/send.h
-m_privmsg.o: m_privmsg.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_privmsg.o: m_privmsg.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_chattr.h ../include/ircd_relay.h \
  ../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \
  ../include/msg.h ../include/numeric.h ../include/send.h
-m_proto.o: m_proto.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_proto.o: m_proto.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \
  ../include/ircd_reply.h ../include/ircd_string.h ../include/numeric.h \
@@ -675,43 +677,43 @@ m_quit.o: m_quit.c ../include/channel.h ../config/config.h \
  ../config/setup.h ../include/ircd_defs.h ../include/client.h \
  ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/struct.h ../include/s_misc.h
-m_rehash.o: m_rehash.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_rehash.o: m_rehash.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_log.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h \
  ../include/numeric.h ../include/s_conf.h ../include/send.h
-m_restart.o: m_restart.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_restart.o: m_restart.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_log.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h \
  ../include/numeric.h ../include/numnicks.h ../include/send.h
-m_rping.o: m_rping.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_rping.o: m_rping.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/opercmds.h ../include/s_user.h \
  ../include/send.h
-m_rpong.o: m_rpong.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_rpong.o: m_rpong.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/opercmds.h ../include/send.h
-m_server.o: m_server.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \
- ../include/hash.h ../include/ircd.h ../config/config.h \
- ../config/setup.h ../include/struct.h ../include/ircd_log.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \
- ../include/match.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_serv.h ../include/send.h ../include/userload.h
-m_settime.o: m_settime.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_server.o: m_server.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
+ ../include/ircd.h ../config/config.h ../config/setup.h \
+ ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \
+ ../include/list.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/s_serv.h ../include/send.h \
+ ../include/userload.h
+m_settime.o: m_settime.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/list.h ../include/msg.h \
@@ -724,8 +726,8 @@ m_silence.o: m_silence.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_user.h ../include/send.h
-m_squit.o: m_squit.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_squit.o: m_squit.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_chattr.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \
@@ -743,8 +745,8 @@ m_stats.o: m_stats.c ../include/s_stats.h ../include/channel.h \
  ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
  ../include/s_serv.h ../include/s_user.h ../include/send.h \
  ../include/userload.h
-m_time.o: m_time.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_time.o: m_time.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
@@ -757,39 +759,39 @@ m_topic.o: m_topic.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/send.h
 m_trace.o: m_trace.c ../include/class.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/hash.h ../include/ircd.h ../config/config.h \
  ../config/setup.h ../include/struct.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \
  ../include/send.h ../include/version.h
-m_uping.o: m_uping.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_uping.o: m_uping.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/match.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
  ../include/s_user.h ../include/send.h ../include/uping.h
-m_user.o: m_user.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_user.o: m_user.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
  ../config/config.h ../config/setup.h ../include/struct.h \
  ../include/ircd_chattr.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
  ../include/send.h
-m_userhost.o: m_userhost.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \
- ../include/s_user.h ../include/struct.h
-m_userip.o: m_userip.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \
- ../include/s_user.h ../include/struct.h
-m_version.o: m_version.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_userhost.o: m_userhost.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/numeric.h ../include/s_user.h \
+ ../include/struct.h
+m_userip.o: m_userip.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/numeric.h ../include/s_user.h \
+ ../include/struct.h
+m_version.o: m_version.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
@@ -803,11 +805,11 @@ m_wallchops.o: m_wallchops.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/numnicks.h ../include/s_user.h \
  ../include/send.h
-m_wallops.o: m_wallops.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/msg.h \
- ../include/numeric.h ../include/send.h
+m_wallops.o: m_wallops.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
+ ../include/send.h
 m_who.o: m_who.c ../include/channel.h ../config/config.h \
  ../config/setup.h ../include/ircd_defs.h ../include/client.h \
  ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
@@ -823,41 +825,41 @@ m_whois.o: m_whois.c ../include/channel.h ../config/config.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
  ../include/msg.h ../include/numeric.h ../include/numnicks.h \
  ../include/s_user.h ../include/send.h ../include/whocmds.h
-m_whowas.o: m_whowas.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_whowas.o: m_whowas.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
  ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/s_user.h ../include/s_misc.h \
  ../include/send.h ../include/whowas.h
-map.o: map.c ../include/map.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_reply.h ../include/list.h ../include/match.h \
- ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
- ../include/send.h
+map.o: map.c ../include/map.h ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/ircd.h ../config/config.h ../config/setup.h \
+ ../include/struct.h ../include/ircd_reply.h ../include/list.h \
+ ../include/match.h ../include/numeric.h ../include/numnicks.h \
+ ../include/querycmds.h ../include/send.h
 match.o: match.c ../include/match.h ../include/ircd_chattr.h
 numnicks.o: numnicks.c ../include/numnicks.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
  ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h
 opercmds.o: opercmds.c ../include/opercmds.h ../include/class.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
- ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_chattr.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/listener.h ../include/match.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/s_conf.h ../include/send.h
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
+ ../include/ircd_handler.h ../include/ircd.h ../config/config.h \
+ ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/listener.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
+ ../include/send.h
 packet.o: packet.c ../include/packet.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_chattr.h ../include/parse.h \
  ../include/s_bsd.h ../include/s_misc.h ../include/send.h
 parse.o: parse.c ../include/parse.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/channel.h ../config/config.h ../config/setup.h \
  ../include/handlers.h ../include/hash.h ../include/ircd.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
@@ -871,18 +873,18 @@ parse.o: parse.c ../include/parse.h ../include/client.h \
 querycmds.o: querycmds.c ../include/querycmds.h
 random.o: random.c ../include/random.h ../config/config.h \
  ../config/setup.h
-res.o: res.c ../include/res.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_alloc.h ../include/fda.h ../include/ircd_log.h \
- ../include/ircd_osdep.h ../include/ircd_reply.h \
+res.o: res.c ../include/res.h ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/ircd.h ../config/config.h ../config/setup.h \
+ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
+ ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
  ../include/numeric.h ../include/s_bsd.h ../include/s_debug.h \
  ../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \
  ../include/support.h ../include/sys.h
 s_auth.o: s_auth.c ../include/s_auth.h ../config/config.h \
- ../config/setup.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/IPcheck.h \
+ ../config/setup.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/IPcheck.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
  ../include/fda.h ../include/ircd_chattr.h ../include/ircd_log.h \
  ../include/ircd_osdep.h ../include/ircd_string.h ../include/list.h \
@@ -890,8 +892,8 @@ s_auth.o: s_auth.c ../include/s_auth.h ../config/config.h \
  ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
  ../include/send.h ../include/sprintf_irc.h ../include/sys.h
 s_bsd.o: s_bsd.c ../include/s_bsd.h ../config/config.h \
- ../config/setup.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/IPcheck.h \
+ ../config/setup.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/IPcheck.h \
  ../include/channel.h ../include/class.h ../include/hash.h \
  ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \
  ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \
@@ -903,8 +905,8 @@ s_bsd.o: s_bsd.c ../include/s_bsd.h ../config/config.h \
  ../include/send.h ../include/sprintf_irc.h ../include/support.h \
  ../include/sys.h ../include/uping.h ../include/version.h
 s_conf.o: s_conf.c ../include/s_conf.h ../include/IPcheck.h \
- ../include/class.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \
+ ../include/class.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/crule.h \
  ../include/fileio.h ../include/gline.h ../config/config.h \
  ../config/setup.h ../include/hash.h ../include/ircd.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
@@ -949,25 +951,24 @@ s_numeric.o: s_numeric.c ../include/s_numeric.h ../include/channel.h \
 s_serv.o: s_serv.c ../include/s_serv.h ../include/IPcheck.h \
  ../include/channel.h ../config/config.h ../config/setup.h \
  ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_handler.h ../include/crule.h ../include/gline.h \
- ../include/hash.h ../include/ircd.h ../include/struct.h \
- ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h \
- ../include/ircd_snprintf.h ../include/ircd_xopen.h ../include/jupe.h \
- ../include/list.h ../include/msg.h ../include/match.h \
- ../include/numeric.h ../include/numnicks.h ../include/parse.h \
- ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
- ../include/send.h ../include/sprintf_irc.h ../include/sys.h \
- ../include/userload.h
+ ../include/ircd_handler.h ../include/gline.h ../include/hash.h \
+ ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
+ ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/ircd_snprintf.h \
+ ../include/ircd_xopen.h ../include/jupe.h ../include/list.h \
+ ../include/msg.h ../include/match.h ../include/numeric.h \
+ ../include/numnicks.h ../include/parse.h ../include/querycmds.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/s_user.h ../include/send.h \
+ ../include/sprintf_irc.h ../include/sys.h ../include/userload.h
 s_stats.o: s_stats.c ../include/s_stats.h ../include/class.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
- ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_chattr.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/listener.h ../include/match.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/s_conf.h ../include/s_user.h ../include/send.h
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
+ ../include/ircd_handler.h ../include/ircd.h ../config/config.h \
+ ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/listener.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
+ ../include/s_user.h ../include/send.h
 s_user.o: s_user.c ../include/s_user.h ../include/IPcheck.h \
  ../include/channel.h ../config/config.h ../config/setup.h \
  ../include/ircd_defs.h ../include/class.h ../include/client.h \
@@ -1010,7 +1011,7 @@ uping.o: uping.c ../include/uping.h ../include/ircd_defs.h \
  ../include/s_misc.h ../include/s_user.h ../include/send.h \
  ../include/sys.h
 userload.o: userload.c ../include/userload.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/msg.h ../include/numnicks.h \
  ../include/querycmds.h ../include/s_misc.h ../include/send.h \
@@ -1028,7 +1029,7 @@ whocmds.o: whocmds.c ../include/whocmds.h ../config/config.h \
  ../include/userload.h ../include/version.h ../include/whowas.h \
  ../include/msg.h
 whowas.o: whowas.c ../include/whowas.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
  ../include/ircd.h ../config/config.h ../config/setup.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_chattr.h ../include/ircd_string.h ../include/list.h \
index c785dc3723f6bd5d7769b0d82c89be0d0bceca44..1c544bcd4d22c91909885e3765ba55e6b5f111a9 100644 (file)
@@ -97,7 +97,7 @@ struct Membership* find_member_link(struct Channel* chptr, const struct Client*
   assert(0 != chptr);
   
   /* Servers don't have member links */
-  if (IsServer(cptr))
+  if (IsServer(cptr)||IsMe(cptr))
      return 0;
   
   /* +k users are typically on a LOT of channels.  So we iterate over who
index 1745f99313fcc823780908f885126767a04b5bea..fc451592d0d185cad43ff09cf75d8d534747e69c 100644 (file)
@@ -20,7 +20,6 @@
  * $Id$
  */
 #include "ircd.h"
-
 #include "IPcheck.h"
 #include "class.h"
 #include "client.h"
@@ -482,7 +481,7 @@ static void event_loop(void) {
     /* timeout pending queries that haven't been responded to */
     timeout_auth_queries(CurrentTime);
 
-    ip_registry_expire();
+    IPcheck_expire();
 
     if (GlobalRehashFlag) {
       rehash(&me, 1);
@@ -494,7 +493,6 @@ static void event_loop(void) {
   }
 }
 
-
 /*----------------------------------------------------------------------------
  * check_file_access:  random helper function to make sure that a file is
  *                     accessible in a certain way, and complain if not.
@@ -666,6 +664,7 @@ int main(int argc, char **argv) {
   }
 
   uping_init();
+
   read_tlines();
 
   rmotd       = read_motd(RPATH);
index bc4c9c4620cfefe60c4555dd0ef3606f01043ab8..4976e134dd1a15d9f4281a95fb8e1c9692294288 100644 (file)
@@ -182,7 +182,7 @@ NTL_HDR_strChattr { NTL_SRC_strChattr }
 NTL_HDR_strCasediff { NTL_SRC_strCasediff }
 #endif /* !FORCEINLINE */
 
-/*=============================================================================
+/*
  * Other functions visible externally
  */
 
index aaee36113140dfd2dd34e672c94b4e9645d16605..58df1b706d79294e558e303d6c6ad139163fccfe 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "class.h"
 #include "client.h"
-#include "IPcheck.h"
 #include "ircd.h"
 #include "ircd_alloc.h"
 #include "ircd_reply.h"
@@ -182,7 +181,6 @@ void free_client(struct Client* cptr)
     if (cptr->dns_reply)
       --cptr->dns_reply->ref_count;
     if (-1 < cptr->fd) {
-      ip_registry_local_disconnect(cptr);
       close(cptr->fd);
     }
     DBufClear(&cptr->sendQ);
index 90fe89488cc8c6de020d1ed0712522ddbed90ce9..072b567dd94bdec4894635fea9eaace16c6bb409 100644 (file)
@@ -183,8 +183,8 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter)
     flag = 1;
     if (mlen + idx + NICKLEN + 5 > BUFSIZE)
       /* space, modifier, nick, \r \n \0 */
-    {
-      send_reply(sptr, RPL_NAMREPLY, buf);
+    { 
+      sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, sptr->name, buf);
       strcpy(buf, "* ");
       ircd_strncpy(buf + 2, chptr->chname, len + 1);
       buf[len + 2] = 0;
@@ -218,16 +218,17 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char* s;
   char* para = parc > 1 ? parv[1] : 0; 
 
-  if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc,
-                                 parv))
+  if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, parv))
     return 0; 
 
-  if (EmptyString(para))
+  if (EmptyString(para)) {
+    send_reply(sptr, RPL_ENDOFNAMES, "*");
     return 0;
+  }
   else if (*para == '0')
     *para = '\0';
   
-  s = strchr(para, ','); /* Recursively call m_names for each comma-seperated channel. */
+  s = strchr(para, ','); /* Recursively call m_names for each comma-seperated channel. Eww. */
   if (s) {
     parv[1] = ++s;
     m_names(cptr, sptr, parc, parv);
@@ -326,7 +327,6 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       send_reply(sptr, RPL_ENDOFNAMES, chptr ? chptr->chname : para);
       return 1;
     }
-
   }
     else
   {
@@ -361,12 +361,13 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char* s;
   char* para = parc > 1 ? parv[1] : 0; 
 
-  if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc,
-                                 parv))
+  if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, parv))
     return 0; 
 
-  if (EmptyString(para))
+  if (EmptyString(para)) {
+    send_reply(sptr, RPL_ENDOFNAMES, "*");
     return 0;
+  }
   else if (*para == '0')
     *para = '\0';
   
index aa388825fe470858dbd7de1aded3e6ed87dcc4d6..2f5eda737ea66d081d9888676ec708e218633077 100644 (file)
@@ -217,6 +217,7 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (IsUnknown(acptr) && MyConnect(acptr)) {
     ++ServerStats->is_ref;
+    IPcheck_connect_fail(acptr->ip);
     exit_client(cptr, acptr, &me, "Overridden by other sign on");
     return set_nick_name(cptr, sptr, nick, parc, parv);
   }
@@ -382,6 +383,7 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (IsUnknown(acptr) && MyConnect(acptr)) {
     ++ServerStats->is_ref;
+    IPcheck_connect_fail(acptr->ip);
     exit_client(cptr, acptr, &me, "Overridden by other sign on");
     return set_nick_name(cptr, sptr, nick, parc, parv);
   }
@@ -674,6 +676,7 @@ int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   if (IsUnknown(acptr) && MyConnect(acptr))
   {
     ++ServerStats->is_ref;
+    IPcheck_connect_fail(acptr->ip);
     exit_client(cptr, acptr, &me, "Overridden by other sign on");
     return set_nick_name(cptr, sptr, nick, parc, parv);
   }
index 33fda6a12ac0ab48db8887cb40565a2494ce4ec0..93053f46738af1ba20777c6c19e7a360311915c9 100644 (file)
@@ -56,9 +56,9 @@
  */
 
 /*
- * when n2k comes, define this for more capacity
+ * Lets have *LOTS* of connections...
  */
-#undef  EXTENDED_NUMERICS
+#define  EXTENDED_NUMERICS
 
 /* These must be the same on ALL servers ! Do not change ! */
 
index 2a4287b1caafa577369d72cbc0f40d988a6c96f6..b2c7657338d51dd936b7a78d38968f15a8991acf 100644 (file)
@@ -532,6 +532,19 @@ struct Message msgtab[] = {
     /* UNREG, CLIENT, SERVER, OPER, SERVICE */
     { m_proto, m_proto, m_proto, m_proto, m_ignore }
   },
+  /* This command is an alias for QUIT during the unregistered part of
+   * of the server.  This is because someone jumping via a broken web
+   * proxy will send a 'POST' as their first command - which we will
+   * obviously disconnect them immediately for, stopping people abusing
+   * open gateways
+   */
+  {
+    MSG_POST,
+    TOK_POST,
+    0, MAXPARA, MFLG_SLOW, 0,
+    /* UNREG, CLIENT, SERVER, OPER, SERVICE */
+    { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
+  },  
   { 0 }
 }; 
 
index 46ed91f0d2d96a0c7436ff5ed270570f345c833d..d5d84ec6a304f7df93d827ebd0efb46fc03af089 100644 (file)
@@ -177,6 +177,7 @@ static void auth_kill_client(struct AuthRequest* auth)
 
   if (IsDNSPending(auth))
     delete_resolver_queries(auth);
+  IPcheck_disconnect(auth->client);
   Count_unknowndisconnects(UserStats);
   free_client(auth->client);
   free_auth_request(auth);
@@ -539,7 +540,7 @@ void start_auth(struct Client* client)
       ++client->dns_reply->ref_count;
       ircd_strncpy(client->sockhost, client->dns_reply->hp->h_name, HOSTLEN);
       if (IsUserPort(auth->client))
-        sendheader(client, REPORT_FIN_DNSC);
+       sendheader(client, REPORT_FIN_DNSC);
     }
     else
       SetDNSPending(auth);
index 64a251f8ca87e2a18409bfca7aa8eb64857a1588..cda4eb7ebf5f0ad6b52dfe47433147646251b226 100644 (file)
@@ -151,6 +151,7 @@ void report_error(const char* text, const char* who, int err)
   static time_t last_notice = 0;
   int           errtmp = errno;   /* debug may change 'errno' */
   const char*   errmsg = (err) ? strerror(err) : "";
+
   if (!errmsg)
     errmsg = "Unknown error"; 
 
@@ -185,7 +186,7 @@ static void connect_dns_callback(void* vptr, struct DNSReply* reply)
   }
   else
     sendto_opmask_butone(0, SNO_OLDSNO, "Connect to %s failed: host lookup",
-                        aconf->name);
+                         aconf->name);
 }
 
 /*
@@ -403,7 +404,7 @@ static int completed_connection(struct Client* cptr)
     if (!msg)
       msg = "Unknown error";
     sendto_opmask_butone(0, SNO_OLDSNO, "Connection failed to %s: %s",
-                        cptr->name, msg);
+                         cptr->name, msg);
     return 0;
   }
   if (!(aconf = find_conf_byname(cptr->confs, cptr->name, CONF_SERVER))) {
@@ -440,8 +441,8 @@ static int completed_connection(struct Client* cptr)
   cptr->flags |= FLAGS_PINGSENT;
 
   sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s",
-               me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL, 
-               NumServCap(&me), me.info);
+                me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL, 
+                NumServCap(&me), me.info);
 
   return (IsDead(cptr)) ? 0 : 1;
 }
@@ -510,7 +511,6 @@ void close_connection(struct Client *cptr)
 
   if (-1 < cptr->fd) {
     flush_connections(cptr);
-    ip_registry_local_disconnect(cptr);
     LocalClientArray[cptr->fd] = 0;
     close(cptr->fd);
     cptr->fd = -1;
@@ -588,15 +588,15 @@ void add_connection(struct Listener* listener, int fd) {
    *
    * If they're throttled, murder them, but tell them why first.
    */
-  if ( !ip_registry_check_local(addr.sin_addr.s_addr,&next_target) ) {
-       ++ServerStats->is_ref;
-       write(fd,throttle_message,strlen(throttle_message));
-       close(fd);
-       return;
+  if (!IPcheck_local_connect(addr.sin_addr, &next_target) && !listener->server) {
+    ++ServerStats->is_ref;
+     write(fd, throttle_message, strlen(throttle_message));
+     close(fd);
+     return;
   }
 
   new_client = make_client(0, ((listener->server) ? 
-                              STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER));
+                               STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER));
 
   /*
    * Copy ascii address to 'sockhost' just in case. Then we have something
@@ -615,7 +615,6 @@ void add_connection(struct Listener* listener, int fd) {
   ++listener->ref_count;
 
   Count_newunknown(UserStats);
-  ip_registry_connect_succeeded(new_client);
   /* if we've made it this far we can put the client on the auth query pile */
   start_auth(new_client);
 }
@@ -1061,8 +1060,7 @@ int read_message(time_t delay)
       const char* msg = (cptr->error) ? strerror(cptr->error) : "EOF from client";
       if (!msg)
         msg = "Unknown error";
-      exit_client_msg(cptr, cptr, &me, "Read error: %s",
-                      msg);
+      exit_client_msg(cptr, cptr, &me, "Read error: %s", msg);
     }
   }
   return 0;
@@ -1275,8 +1273,7 @@ int read_message(time_t delay)
       const char* msg = (cptr->error) ? strerror(cptr->error) : "EOF from client";
       if (!msg)
         msg = "Unknown error";
-      exit_client_msg(cptr, cptr, &me, "Read error: %s",
-                      msg);
+      exit_client_msg(cptr, cptr, &me, "Read error: %s", msg);
     }
   }
   return 0;
@@ -1305,7 +1302,7 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
 
   if (aconf->dns_pending) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Server %s connect DNS pending",
-                        aconf->name);
+                         aconf->name);
     return 0;
   }
   Debug((DEBUG_NOTICE, "Connect to %s[@%s]", aconf->name,
@@ -1314,17 +1311,17 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
   if ((cptr = FindClient(aconf->name))) {
     if (IsServer(cptr) || IsMe(cptr)) {
       sendto_opmask_butone(0, SNO_OLDSNO, "Server %s already present from %s", 
-                          aconf->name, cptr->from->name);
+                           aconf->name, cptr->from->name);
       if (by && IsUser(by) && !MyUser(by)) {
-       sendcmdto_one(&me, CMD_NOTICE, by, "%C :Server %s already present "
-                     "from %s", by, aconf->name, cptr->from->name);
+        sendcmdto_one(&me, CMD_NOTICE, by, "%C :Server %s already present "
+                      "from %s", by, aconf->name, cptr->from->name);
       }
       return 0;
     }
     else if (IsHandshake(cptr) || IsConnecting(cptr)) {
       if (by && IsUser(by)) {
-       sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connection to %s already in "
-                     "progress", by, cptr->name);
+        sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connection to %s already in "
+                      "progress", by, cptr->name);
       }
       return 0;
     }
@@ -1372,10 +1369,10 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
 
   if (!find_conf_byhost(cptr->confs, aconf->host, CONF_SERVER)) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Host %s is not enabled for "
-                        "connecting: no C-line", aconf->name);
+                         "connecting: no C-line", aconf->name);
     if (by && IsUser(by) && !MyUser(by)) {
       sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connect to host %s failed: no "
-                   "C-line", by, aconf->name);
+                    "C-line", by, aconf->name);
     }
     det_confs_butmask(cptr, 0);
     free_client(cptr);
@@ -1387,7 +1384,7 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
   if (!connect_inet(aconf, cptr)) {
     if (by && IsUser(by) && !MyUser(by)) {
       sendcmdto_one(&me, CMD_NOTICE, by, "%C :Couldn't connect to %s", by,
-                   cptr->name);
+                    cptr->name);
     }
     det_confs_butmask(cptr, 0);
     free_client(cptr);
@@ -1421,12 +1418,10 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
   LocalClientArray[cptr->fd] = cptr;
 
   Count_newunknown(UserStats);
-  ip_registry_add_local(aconf->ipnum.s_addr);
   /* Actually we lie, the connect hasn't succeeded yet, but we have a valid
    * cptr, so we register it now.
    * Maybe these two calls should be merged.
    */
-  ip_registry_connect_succeeded(cptr);
   add_client_to_list(cptr);
   hAddClient(cptr);
   nextping = CurrentTime;
index 1f64ecc5f9252266e48995c3d72966483143fd3a..8385689d7fdd3513ed23d6b83ec77384f133ecc6 100644 (file)
@@ -325,7 +325,7 @@ check_limit_and_attach(struct Client* cptr, struct ConfItem* aconf)
              !aconf->passwd[2])
       number = (*aconf->passwd-'0')*10+(aconf->passwd[1]-'0');
   }
-  if (ip_registry_count(cptr->ip.s_addr) > number)
+  if (IPcheck_nr(cptr) > number)
     return ACR_TOO_MANY_FROM_IP;
   return attach_conf(cptr, aconf);
 }
index 20e8a1842dbe6425d2dcff704ebdcc9dbb86c79a..f9053310881312d29959945e056210d500544137 100644 (file)
@@ -147,9 +147,7 @@ char *myctime(time_t value)
  *
  *    Returns:
  *      "name[user@ip#.port]" if 'showip' is true;
- *      "name[sockethost]", if name and sockhost are different and
- *      showip is false; else
- *      "name".
+ *      "name" if 'showip' is false.
  *
  *  NOTE 1:
  *    Watch out the allocation of "nbuf", if either sptr->name
@@ -169,12 +167,8 @@ const char* get_client_name(const struct Client* sptr, int showip)
     if (showip)
       sprintf_irc(nbuf, "%s[%s@%s]", sptr->name,
             (IsIdented(sptr)) ? sptr->username : "", sptr->sock_ip);
-    else {
-      if (0 != ircd_strcmp(sptr->name, sptr->sockhost))
-        sprintf_irc(nbuf, "%s[%s]", sptr->name, sptr->sockhost);
-      else
+    else
         return sptr->name;
-    }
     return nbuf;
   }
   return sptr->name;
@@ -256,7 +250,6 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
       Count_clientdisconnects(bcptr, UserStats);
     else {
       Count_remoteclientquits(UserStats, bcptr);
-      ip_registry_remote_disconnect(bcptr);
     }
   }
   else if (IsServer(bcptr))
@@ -279,6 +272,11 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
   else if (IsUnknown(bcptr) || IsConnecting(bcptr) || IsHandshake(bcptr))
     Count_unknowndisconnects(UserStats);
 
+  /*
+   * Update IPregistry
+   */
+  if (IsIPChecked(bcptr))
+    IPcheck_disconnect(bcptr);
 
   /* 
    * Remove from serv->client_list
@@ -302,6 +300,7 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
 #endif
   remove_client_from_list(bcptr);
 }
+
 /*
  * exit_downlinks - added by Run 25-9-94
  *
index 9c8574388304fa023317ecab88d430e7a684fc7d..dab6bfb5decc0f8e94fbe34d3f79ca451dee88cd 100644 (file)
@@ -80,7 +80,7 @@ int exit_new_server(struct Client* cptr, struct Client* sptr,
 #endif /* 0 */
 
 int exit_new_server(struct Client *cptr, struct Client *sptr, const char *host,
-                   time_t timestamp, const char *pattern, ...)
+                    time_t timestamp, const char *pattern, ...)
 {
   struct VarData vd;
   int retval = 0;
@@ -111,7 +111,7 @@ int a_kills_b_too(struct Client *a, struct Client *b)
  * and thus make_server was called, and serv->prot set. --Run
  */
 int server_estab(struct Client *cptr, struct ConfItem *aconf,
-                struct Jupe *ajupe)
+                 struct Jupe *ajupe)
 {
   struct Client* acptr = 0;
   const char*    inpath;
@@ -131,8 +131,14 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf,
      *  Pass my info to the new server
      */
     sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s", me.name,
-                 me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL,
-                 NumServCap(&me), *me.info ? me.info : "IRCers United");
+                  me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL,
+                  NumServCap(&me), *me.info ? me.info : "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->ip);
   }
 
   det_confs_butmask(cptr, CONF_LEAF | CONF_HUB | CONF_SERVER | CONF_UWORLD);
@@ -157,7 +163,7 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf,
       (acptr = findNUser(cptr->serv->by))) {
     if (acptr->user == cptr->serv->user) {
       sendcmdto_one(&me, CMD_NOTICE, acptr, "%C :Link with %s established.",
-                   acptr, inpath);
+                    acptr, inpath);
     }
     else {
       /*
@@ -172,7 +178,7 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf,
   cptr->serv->up = &me;
   cptr->serv->updown = add_dlink(&me.serv->down, cptr);
   sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s", me.name,
-                      cptr->name);
+                       cptr->name);
   SetJunction(cptr);
   /*
    * Old sendto_serv_but_one() call removed because we now
@@ -188,14 +194,14 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf,
       continue;
     if (ajupe)
       sendcmdto_one(&me, CMD_SERVER, acptr,
-                   "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cptr->name,
-                   cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
-                   JupeLastMod(ajupe), cptr->info);
+                    "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cptr->name,
+                    cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
+                    JupeLastMod(ajupe), cptr->info);
     else
       sendcmdto_one(&me, CMD_SERVER, acptr,
-                   "%s 2 0 %Tu J%02u %s%s 0 :%s", cptr->name,
-                   cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
-                   cptr->info);
+                    "%s 2 0 %Tu J%02u %s%s 0 :%s", cptr->name,
+                    cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
+                    cptr->info);
   }
 
   /*
@@ -231,17 +237,17 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf,
                0 != ircd_strcmp(acptr->name, acptr->sockhost) &&
                0 != ircd_strncmp(acptr->info, "JUPE", 4));
       if ((ajupe = jupe_find(acptr->name)) && !JupeIsLocal(ajupe))
-       sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
-                     "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", acptr->name,
-                     acptr->hopcount + 1, acptr->serv->timestamp,
-                     protocol_str, Protocol(acptr), NumServCap(acptr),
-                     JupeLastMod(ajupe), acptr->info);
+        sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
+                      "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", acptr->name,
+                      acptr->hopcount + 1, acptr->serv->timestamp,
+                      protocol_str, Protocol(acptr), NumServCap(acptr),
+                      JupeLastMod(ajupe), acptr->info);
       else
-       sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
-                     "%s %d 0 %Tu %s%u %s%s 0 :%s", acptr->name,
-                     acptr->hopcount + 1, acptr->serv->timestamp,
-                     protocol_str, Protocol(acptr), NumServCap(acptr),
-                     acptr->info);
+        sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
+                      "%s %d 0 %Tu %s%u %s%s 0 :%s", acptr->name,
+                      acptr->hopcount + 1, acptr->serv->timestamp,
+                      protocol_str, Protocol(acptr), NumServCap(acptr),
+                      acptr->info);
     }
   }
 
@@ -256,23 +262,23 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf,
       char *s = umode_str(acptr);
       struct Gline *agline = 0;
       if ((agline = gline_lookup(acptr, GLINE_GLOBAL | GLINE_LASTMOD)))
-       sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
-                     "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
-                     acptr->name, acptr->hopcount + 1, acptr->lastnick,
-                     acptr->user->username, acptr->user->host,
-                     *s ? "+" : "", s, *s ? " " : "",
-                     GlineLastMod(agline), GlineUser(agline),
-                     GlineHost(agline),
-                     inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
-                     NumNick(acptr), acptr->info);
+        sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
+                      "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
+                      acptr->name, acptr->hopcount + 1, acptr->lastnick,
+                      acptr->user->username, acptr->user->host,
+                      *s ? "+" : "", s, *s ? " " : "",
+                      GlineLastMod(agline), GlineUser(agline),
+                      GlineHost(agline),
+                      inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
+                      NumNick(acptr), acptr->info);
       else
-       sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
-                     "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
-                     acptr->name, acptr->hopcount + 1, acptr->lastnick,
-                     acptr->user->username, acptr->user->host,
-                     *s ? "+" : "", s, *s ? " " : "",
-                     inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
-                     NumNick(acptr), acptr->info);
+        sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
+                      "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
+                      acptr->name, acptr->hopcount + 1, acptr->lastnick,
+                      acptr->user->username, acptr->user->host,
+                      *s ? "+" : "", s, *s ? " " : "",
+                      inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
+                      NumNick(acptr), acptr->info);
     }
   }
   /*
index 813cf0f93d35de7fdf86ea43e50268f95b44b0b5..f3222ecbe33eaf5c47aedffc5b13b472584950fa 100644 (file)
@@ -238,8 +238,11 @@ int hunt_server(int MustBeOper, struct Client *cptr, struct Client *sptr, char *
   {
     /* Make sure it's a server */
     if (!strchr(parv[server], '*')) {
-      if (0 == (acptr = FindClient(parv[server])))
+      if (0 == (acptr = FindClient(parv[server]))) {
+        sendto_one(sptr, err_str(ERR_NOSUCHSERVER),
+            me.name, parv[0], parv[server]);
         return HUNTED_NOSUCH;
+      }
       if (acptr->user)
         acptr = acptr->user->server;
     }
@@ -273,8 +276,8 @@ int hunt_server(int MustBeOper, struct Client *cptr, struct Client *sptr, char *
 }
 
 int hunt_server_cmd(struct Client *from, const char *cmd, const char *tok,
-                   struct Client *one, int MustBeOper, const char *pattern,
-                   int server, int parc, char *parv[])
+                    struct Client *one, int MustBeOper, const char *pattern,
+                    int server, int parc, char *parv[])
 {
   struct Client *acptr;
   char *to;
@@ -312,7 +315,7 @@ int hunt_server_cmd(struct Client *from, const char *cmd, const char *tok,
   parv[server] = (char *) acptr; /* HACK! HACK! HACK! ARGH! */
 
   sendcmdto_one(from, cmd, tok, acptr, pattern, parv[1], parv[2], parv[3],
-               parv[4], parv[5], parv[6], parv[7], parv[8]);
+                parv[4], parv[5], parv[6], parv[7], parv[8]);
 
   return (HUNTED_PASS);
 }
@@ -443,37 +446,39 @@ int register_user(struct Client *cptr, struct Client *sptr,
         break;
       case ACR_NO_AUTHORIZATION:
         sendto_opmask_butone(0, SNO_UNAUTH, "Unauthorized connection from %s.",
-                            get_client_name(sptr, HIDE_IP));
+                             get_client_name(sptr, HIDE_IP));
         ++ServerStats->is_ref;
         return exit_client(cptr, sptr, &me,
-                          "No Authorization - use another server");
+                           "No Authorization - use another server");
       case ACR_TOO_MANY_IN_CLASS:
         if (CurrentTime - last_too_many1 >= (time_t) 60)
         {
           last_too_many1 = CurrentTime;
           sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections in "
-                              "class for %s.",
-                              get_client_name(sptr, HIDE_IP));
+                               "class for %s.",
+                               get_client_name(sptr, HIDE_IP));
         }
         ++ServerStats->is_ref;
+        IPcheck_connect_fail(sptr->ip);
         return exit_client(cptr, sptr, &me,
-                          "Sorry, your connection class is full - try "
-                          "again later or try another server");
+                           "Sorry, your connection class is full - try "
+                           "again later or try another server");
       case ACR_TOO_MANY_FROM_IP:
         if (CurrentTime - last_too_many2 >= (time_t) 60)
         {
           last_too_many2 = CurrentTime;
           sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections from "
-                              "same IP for %s.",
-                              get_client_name(sptr, HIDE_IP));
+                               "same IP for %s.",
+                               get_client_name(sptr, HIDE_IP));
         }
         ++ServerStats->is_ref;
         return exit_client(cptr, sptr, &me,
-                          "Too many connections from your host");
+                           "Too many connections from your host");
       case ACR_ALREADY_AUTHORIZED:
         /* Can this ever happen? */
       case ACR_BAD_SOCKET:
         ++ServerStats->is_ref;
+        IPcheck_connect_fail(sptr->ip);
         return exit_client(cptr, sptr, &me, "Unknown error -- Try again");
     }
     ircd_strncpy(user->host, sptr->sockhost, HOSTLEN);
@@ -492,6 +497,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
         && strcmp(sptr->passwd, aconf->passwd))
     {
       ServerStats->is_ref++;
+      IPcheck_connect_fail(sptr->ip);
       send_reply(sptr, ERR_PASSWDMISMATCH);
       return exit_client(cptr, sptr, &me, "Bad Password");
     }
@@ -501,6 +507,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
      */
     if (find_kill(sptr)) {
       ServerStats->is_ref++;
+      IPcheck_connect_fail(sptr->ip);
       return exit_client(cptr, sptr, &me, "K-lined");
     }
     /*
@@ -573,12 +580,12 @@ int register_user(struct Client *cptr, struct Client *sptr,
       ServerStats->is_ref++;
 
       send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME,
-                ":Your username is invalid.");
+                 ":Your username is invalid.");
       send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME,
-                ":Connect with your real username, in lowercase.");
+                 ":Connect with your real username, in lowercase.");
       send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME,
-                ":If your mail address were foo@bar.com, your username "
-                "would be foo.");
+                 ":If your mail address were foo@bar.com, your username "
+                 "would be foo.");
       return exit_client(cptr, sptr, &me, "USER: Bad username");
     }
     Count_unknownbecomesclient(sptr, UserStats);
@@ -625,6 +632,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
     nextping = CurrentTime;
     if (sptr->snomask & SNO_NOISY)
       set_snomask(sptr, sptr->snomask & SNO_NOISY, SNO_ADD);
+    IPcheck_connect_succeeded(sptr);
   }
   else
     /* if (IsServer(cptr)) */
@@ -635,8 +643,8 @@ int register_user(struct Client *cptr, struct Client *sptr,
     if (acptr->from != sptr->from)
     {
       sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s != %s[%s])",
-                   sptr, me.name, user->server->name, acptr->from->name,
-                   acptr->from->sockhost);
+                    sptr, me.name, user->server->name, acptr->from->name,
+                    acptr->from->sockhost);
       sptr->flags |= FLAGS_KILLED;
       return exit_client(cptr, sptr, &me, "NICK server wrong direction");
     }
@@ -653,26 +661,34 @@ int register_user(struct Client *cptr, struct Client *sptr,
       if (IsBurst(acptr) || Protocol(acptr) < 10)
         break;
     }
+    if (!IPcheck_remote_connect(sptr, (acptr != &me))) {
+      /*
+       * We ran out of bits to count this
+       */
+      sendcmdto_one(&me, CMD_KILL, sptr, "%C :%s (Too many connections from your host -- Ghost)",
+                    sptr, me.name);
+      return exit_client(cptr, sptr, &me,"Too many connections from your host -- throttled");
+    }
   }
   tmpstr = umode_str(sptr);
   if (agline)
     sendcmdto_serv_butone(user->server, CMD_NICK, cptr,
-                         "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
-                         nick, sptr->hopcount + 1, sptr->lastnick,
-                         user->username, user->host,
-                         *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
-                         GlineLastMod(agline), GlineUser(agline),
-                         GlineHost(agline),
-                         inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
-                         NumNick(sptr), sptr->info);
+                          "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
+                          nick, sptr->hopcount + 1, sptr->lastnick,
+                          user->username, user->host,
+                          *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
+                          GlineLastMod(agline), GlineUser(agline),
+                          GlineHost(agline),
+                          inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
+                          NumNick(sptr), sptr->info);
   else
     sendcmdto_serv_butone(user->server, CMD_NICK, cptr,
-                         "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
-                         nick, sptr->hopcount + 1, sptr->lastnick,
-                         user->username, user->host,
-                         *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
-                         inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
-                         NumNick(sptr), sptr->info);
+                          "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
+                          nick, sptr->hopcount + 1, sptr->lastnick,
+                          user->username, user->host,
+                          *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
+                          inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
+                          NumNick(sptr), sptr->info);
   
   /* Send umode to client */
   if (MyUser(sptr))
@@ -776,16 +792,10 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
       lastmod = atoi(parv[parc - 4] + 1);
 
       if (lastmod &&
-         (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD))
-         && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr))
-       gline_resend(cptr, agline);
-    }
-    if (!ip_registry_remote_connect(new_client)) {
-       sendcmdto_one(&me, CMD_KILL, new_client, "%C :%s (Too many connections from your host -- Ghost)",
-                     new_client,me.name);
-       return exit_client(cptr,new_client,&me,"Too many connections from your host -- throttled");
+          (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD))
+          && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr))
+        gline_resend(cptr, agline);
     }
-    sendto_ops("Registering new remote client");
     return register_user(cptr, new_client, new_client->name, parv[4], agline);
   }
   else if (sptr->name[0]) {
@@ -799,7 +809,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
     if (MyUser(sptr)) {
       const char* channel_name;
       if ((channel_name = find_no_nickchange_channel(sptr))) {
-       return send_reply(cptr, ERR_BANNICKCHANGE, channel_name);
+        return send_reply(cptr, ERR_BANNICKCHANGE, channel_name);
       }
       /*
        * Refuse nick change if the last nick change was less
@@ -811,10 +821,10 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
        */
       if (CurrentTime < cptr->nextnick) {
         cptr->nextnick += 2;
-       send_reply(cptr, ERR_NICKTOOFAST, parv[1],
-                  cptr->nextnick - CurrentTime);
+        send_reply(cptr, ERR_NICKTOOFAST, parv[1],
+                   cptr->nextnick - CurrentTime);
         /* Send error message */
-       sendcmdto_one(cptr, CMD_NICK, cptr, "%s", cptr->name);
+        sendcmdto_one(cptr, CMD_NICK, cptr, "%s", cptr->name);
         /* bounce NICK to user */
         return 0;                /* ignore nick change! */
       }
@@ -841,7 +851,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr,
       sendcmdto_common_channels(sptr, CMD_NICK, ":%s", nick);
       add_history(sptr, 1);
       sendcmdto_serv_butone(sptr, CMD_NICK, cptr, "%s %Tu", nick,
-                           sptr->lastnick);
+                            sptr->lastnick);
     }
     else
       sendcmdto_one(sptr, CMD_NICK, sptr, ":%s", nick);
@@ -965,8 +975,8 @@ int check_target_limit(struct Client *sptr, void *target, const char *name,
          * No server flooding
          */
         sptr->nexttarget += 2;
-       send_reply(sptr, ERR_TARGETTOOFAST, name,
-                  sptr->nexttarget - CurrentTime);
+        send_reply(sptr, ERR_TARGETTOOFAST, name,
+                   sptr->nexttarget - CurrentTime);
       }
       return 1;
     }
@@ -1110,8 +1120,7 @@ void send_user_info(struct Client* sptr, char* names, int rpl, InfoFormatter fmt
     if (5 == ++arg_count)
       break;
   }
-  if (users_found)
-    send_buffer(sptr, buf);
+  send_buffer(sptr, buf);
 }
 
 
@@ -1150,8 +1159,8 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv
   {
     if (IsServer(cptr))
       sendcmdto_flag_butone(&me, CMD_WALLOPS, 0, FLAGS_WALLOP,
-                           ":MODE for User %s from %s!%s", parv[1],
-                           cptr->name, sptr->name);
+                            ":MODE for User %s from %s!%s", parv[1],
+                            cptr->name, sptr->name);
     else
       send_reply(sptr, ERR_USERSDONTMATCH);
     return 0;
@@ -1531,8 +1540,8 @@ int is_silenced(struct Client *sptr, struct Client *acptr)
     {
       if (!MyConnect(sptr))
       {
-       sendcmdto_one(acptr, CMD_SILENCE, sptr->from, "%C %s", sptr,
-                     lp->value.cp);
+        sendcmdto_one(acptr, CMD_SILENCE, sptr->from, "%C %s", sptr,
+                      lp->value.cp);
       }
       return 1;
     }
@@ -1590,7 +1599,7 @@ int add_silence(struct Client* sptr, const char* mask)
       len += strlen(lp->value.cp);
       if ((len > MAXSILELENGTH) || (++cnt >= MAXSILES))
       {
-       send_reply(sptr, ERR_SILELISTFULL, mask);
+        send_reply(sptr, ERR_SILELISTFULL, mask);
         return -1;
       }
       else if (!mmatch(lp->value.cp, mask))
index 44eaa7bd23e83da6d07be7b58ca7c5088cee4ea1..e5554f9b9f48967228d08353e27898e2fd35dbe5 100644 (file)
@@ -17,7 +17,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-/*=============================================================================
+/*
  * TABLE GENERATOR
  * The following part of code is NOT included in the actual server's
  * or library source, it's just used to build the above tables
index ab9080177e985a1eb8a59e1575bba844944fc669..accc52d8e55075b763332434f47683f19d6bb1c2 100644 (file)
@@ -173,7 +173,6 @@ static void uping_start(struct UPing* pptr)
   sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :Sending %d ping%s to %s",
                pptr->client, pptr->count, (pptr->count == 1) ? "" : "s",
                pptr->name);
-
   pptr->timeout = CurrentTime + UPINGTIMEOUT;
   pptr->active = 1;
 }