diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/CREDITS ircd-hybrid-6.0/CREDITS
--- ircd-hybrid-6.0.orig/CREDITS	Thu Jan  1 01:00:00 1970
+++ ircd-hybrid-6.0/CREDITS	Mon Jul  2 18:04:50 2001
@@ -0,0 +1,63 @@
+Credits for dancer:
+
+
+---------------------------------------------------------------------
+These are the credits from hybrid-6 itself:
+
+Based on the original code written by Jarkko Oikarinen
+Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 1, or
+(at your option) any later version.
+
+The core Hybrid Team as of this major release:
+
+cosine              Patrick Alken       wnder@uwns.underworld.net
+Dianora             Diane Bruce         db@db.net
+is-                 Edward Brocklesby   ejb@leguin.org.uk
+Neph|l|m            Adel Mezibra        adel@cybercable.fr
+pro                 Bill Jonus          proggy@earthling.net
+Rodder              Jon Lusky           lusky@blown.net
+Wohali              Joan Touzet         jolo@cadence.com
+
+The following people have contributed to this release of hybrid
+in nick alphabetical order:
+
+Bleep               Thomas Helvey       tomh@inxpress.net
+CBongo              Chris Bongaarts     cab@tc.umn.edu
+comstud             Chris Behrens       cbehrens@concentric.net
+echo                Adam J. Durana      adam@caca.com
+FlashMan            Craig A. Huegen     chuegen@quadrunner.com
+jailbird            Dustin Marquess     jailbird@alcatraz.fdf.net
+johan               Johannes Erdfelt    jerdfelt@eng.mindspring.net
+LarZ                Matthew Ramsey      mjr@blackened.com
+orabidoo            Roger Espel Llima   espel@unix.bigots.org
+Seaner              Sean McVeigh        sdlmcvei@uwaterloo.ca
+Shadowfax           Michael Pearce      mpearce@varner.com
+Slowaris            Ryan Parker         rjp@wpmedia.com
+ThemBones           Brian Kraemer       kraemer@u.washington.edu
+White_Dragon        Chip Norkus         wd@dal.net
+WintrHawk           Jake Khuon          khuon@GCtr.Net
+
+
+Developers and Contributors for previous versions:
+
+Chris Portman       Keith Fralick       Jon Mischo
+Sam Noble           Taner Halicioglu    Darren Reed
+Markku Savela       Greg Lindahl        Jarkko Oikarinen
+Armin Gruner        Matthew Green       Chuck Kane
+Matt Lyle           Vesa Ruokonen       Nicolas PIOCH
+Stellan Klebom      Dan Goodwin         Mike Bolotski
+Ian Frechette       Markku Jarvinen     Kimmo Suominen
+Jeff Trim           Vijay Subramaniam   Karl Kleinpaste
+Bill Wisner         Tom Davis           Hugo Calendar
+Tom Hopkins         Stephen van den Berg
+Bo Adler            Michael Sandrof     Jon Solomon
+Jan Peterson        Helen Rose          Paul Graham
+
+Thanks also goes to those persons not mentioned here who have added
+their advice, opinions, and code to IRC.
+Thanks also to those who provide the kind sys admins who let me and
+others continue to develop IRC.
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/client.h ircd-hybrid-6.0/include/client.h
--- ircd-hybrid-6.0.orig/include/client.h	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/include/client.h	Mon Jul  2 18:04:50 2001
@@ -47,6 +47,7 @@
 #ifndef INCLUDED_dbuf_h
 #include "dbuf.h"
 #endif
+#include <sys/time.h>
 
 #define HOSTIPLEN       16      /* Length of dotted quad form of IP        */
                                 /* - Dianora                               */
@@ -103,6 +104,13 @@
   struct ConfItem* nline;       /* N-line pointer for this server */
   struct Client*   servers;     /* Servers on this server */
   struct Client*   users;       /* Users on this server */
+#ifdef TSDELTA
+  /* This stuff for TSDELTA calculations */
+  struct timeval   tsdpong_recv; /* This is when I received pong 1 */
+  struct timeval   utime_recv;  /* This is when I get the response */
+  struct timeval   utime_got;   /* This is what the reponse is */
+  int              tsd_state;   /* 0 == none, 1 == waiting for response, 2 == got first pong, 3 == got utime */
+#endif
 };
 
 /* DO NOT change this without changing the bitfield macros */
@@ -291,8 +299,8 @@
    */
   char              passwd[PASSWDLEN + 1];
   int               caps;       /* capabilities bit-field */
-  time_t            ping_send_time; /* When I last sent a ping */
-  time_t            ping_time;      /* ping RTT */
+  struct timeval    ping_send_time; /* When I last sent a ping */
+  struct timeval    ping_time;      /* ping RTT */
 };
 
 /*
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/config.h ircd-hybrid-6.0/include/config.h
--- ircd-hybrid-6.0.orig/include/config.h	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/include/config.h	Mon Jul  2 19:24:20 2001
@@ -865,6 +865,11 @@
  */
 #undef ALLOW_PRIVATE_CHANNELS
 
+/*
+ * Include the code and data to calculate TSDELTA on request
+ */
+#define TSDELTA
+
 /*   STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP  */
 
 /* You shouldn't change anything below this line, unless absolutely needed. */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/m_commands.h ircd-hybrid-6.0/include/m_commands.h
--- ircd-hybrid-6.0.orig/include/m_commands.h	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/include/m_commands.h	Mon Jul  2 18:47:45 2001
@@ -124,4 +124,13 @@
 extern int m_chall(struct Client *,struct Client *,int,char **);
 extern int m_resp(struct Client *,struct Client *,int,char **);
 #endif
+
+#ifdef TSDELTA
+extern int m_tsdelta(struct Client*, struct Client*, int, char**);
+extern int m_tsdping(struct Client*, struct Client*, int, char**);
+extern int m_tsdpong(struct Client*, struct Client*, int, char**);
+extern int m_utime(struct Client*, struct Client*, int, char**);
+#endif
+
+extern int m_spingtime(struct Client*, struct Client*, int, char**);
 #endif /* INCLUDED_m_commands_h */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/msg.h ircd-hybrid-6.0/include/msg.h
--- ircd-hybrid-6.0.orig/include/msg.h	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/include/msg.h	Mon Jul  2 18:47:35 2001
@@ -60,6 +60,13 @@
 
 typedef struct MessageTree MESSAGE_TREE;
 
+#ifdef TSDELTA
+#define MSG_TSDELTA  "TSDELTA"
+#define MSG_TSDPING  "TSDPING"
+#define MSG_TSDPONG  "TSDPONG"
+#define MSG_UTIME    "UTIME"
+#endif
+
 #ifdef CHALLENGERESPONSE
 #define MSG_CHALL    "CHALL"    /* CHALL */
 #define MSG_RESP     "RESP"     /* RESP */
@@ -158,6 +165,8 @@
 #define MSG_GN                  "GN"                    /* GN */
 #endif
 
+#define MSG_SPINGTIME   "SPINGTIME"
+
 #define MAXPARA    15 
 
 #define MSG_TESTLINE "TESTLINE"
@@ -190,6 +199,13 @@
 #endif  /* IDLE_CHECK */
 #endif  /* IDLE_FROM_MSG */
 
+#ifdef TSDELTA
+  { MSG_TSDELTA, m_tsdelta,  0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_TSDPING, m_tsdping,  0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_TSDPONG, m_tsdpong,  0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_UTIME,   m_utime,    0, MAXPARA, 1, 0, 0, 0L },
+#endif
+
   { MSG_NICK,    m_nick,     0, MAXPARA, 1, 1, 0, 0L },
   { MSG_NOTICE,  m_notice,   0, MAXPARA, 1, 0, 0, 0L },
   { MSG_JOIN,    m_join,     0, MAXPARA, 1, 0, 0, 0L },
@@ -301,11 +317,12 @@
   { MSG_HS,       m_helpserv,      0, 1, 1, 0, 1, 0L },
   { MSG_GLOBAL,   m_global,        0, 1, 1, 0, 1, 0L },
   { MSG_GN,       m_global,        0, 1, 1, 0, 1, 0L },
-  { MSG_SETHOST, m_sethost,  0, 2,       1, 0, 0, 0L },
-  { MSG_SETIDENT, m_setident,0, 2,       1, 0, 0, 0L },
-  { MSG_SETNAME, m_setname,  0, 2, 1, 0, 0, 0L },
-  { MSG_MAKEPASS,m_makepass, 0, 2,       1, 0, 0, 0L },
-  { MSG_STOPIC,  m_stopic,   0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_SETHOST,  m_sethost,       0, 2, 1, 0, 0, 0L },
+  { MSG_SETIDENT, m_setident,      0, 2, 1, 0, 0, 0L },
+  { MSG_SETNAME,  m_setname,       0, 2, 1, 0, 0, 0L },
+  { MSG_MAKEPASS, m_makepass,      0, 2, 1, 0, 0, 0L },
+  { MSG_STOPIC,   m_stopic,   0,MAXPARA, 1, 0, 0, 0L },
+  { MSG_SPINGTIME,m_spingtime,0,MAXPARA, 1, 0, 0, 0L },
 
   { (char *) 0, (int (*)()) 0 , 0, 0,    0, 0, 0, 0L }
 };
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/numeric.h ircd-hybrid-6.0/include/numeric.h
--- ircd-hybrid-6.0.orig/include/numeric.h	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/include/numeric.h	Mon Jul  2 18:04:50 2001
@@ -367,6 +367,7 @@
 #define ERR_USERISIMMUNE     485    /* should this be something else? -dt */
 #define ERR_RESTRICTED       486
 #define ERR_NO_OP_SPLIT      487
+#define ERR_NEED_UMODE       488
 
 #define ERR_NOOPERHOST       491
 
@@ -393,6 +394,8 @@
 #define STR_ADD_BAD_BAN_TYPE 003
 #define STR_DEL_BAD_BAN_TYPE 004
 #define STR_REMOTE_WILD_WHOIS 005
+#define STR_NO_SERV          006
+#define STR_MISSED_UTIME     007
 
 /* 100-***: Other stuff */
 #define STR_TRY_JOIN_JUPE    100
@@ -401,5 +404,9 @@
 #define STR_BOT_WARN         103
 #define STR_BOT_WARN_JOIN    104
 #define STR_KICK_SPY         105
+#define STR_TSDELTA_ME       106
+#define STR_TSDELTA_SPY      107
+#define STR_TSDELTA_RUNNING  108
+#define STR_TSDELTA          109
 
 #endif /* INCLUDED_numeric_h */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/patchlevel.h ircd-hybrid-6.0/include/patchlevel.h
--- ircd-hybrid-6.0.orig/include/patchlevel.h	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/include/patchlevel.h	Mon Jul  2 18:04:50 2001
@@ -17,5 +17,5 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL    "dancer-ircd-0.9.3.3"
+#define PATCHLEVEL    "dancer-ircd-0.9.3.4(rc1)"
 #endif
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/Makefile.in ircd-hybrid-6.0/src/Makefile.in
--- ircd-hybrid-6.0.orig/src/Makefile.in	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/Makefile.in	Mon Jul  2 18:46:14 2001
@@ -108,7 +108,9 @@
 	send.c \
 	sprintf_irc.c \
 	m_map.c \
-	whowas.c
+	whowas.c \
+	tsdelta.c \
+	m_spingtime.c
 
 #
 # Do it this way for Ultrix, and its portable at least
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/client.c ircd-hybrid-6.0/src/client.c
--- ircd-hybrid-6.0.orig/src/client.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/client.c	Mon Jul  2 19:11:17 2001
@@ -504,7 +504,7 @@
        * *sigh* I think not -Dianora
        */
 
-      if (ping < (currenttime - cptr->ping_send_time))
+      if (ping < (currenttime - cptr->ping_send_time.tv_sec))
         {
 
           /*
@@ -554,7 +554,7 @@
               /* not nice but does the job */
               cptr->lasttime = currenttime - ping;
 	      /* does the job better -- asuffield */
-	      cptr->ping_send_time = currenttime;
+	      gettimeofday(&cptr->ping_send_time, NULL);
               sendto_one(cptr, "PING :%s", me.name);
             }
         }
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/include/setup.h ircd-hybrid-6.0/src/include/setup.h
--- ircd-hybrid-6.0.orig/src/include/setup.h	Thu Jan  1 01:00:00 1970
+++ ircd-hybrid-6.0/src/include/setup.h	Mon Jul  2 18:04:50 2001
@@ -0,0 +1 @@
+/* include/setup.h.  Generated automatically by configure.  */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_away.c ircd-hybrid-6.0/src/m_away.c
--- ircd-hybrid-6.0.orig/src/m_away.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_away.c	Mon Jul  2 18:04:50 2001
@@ -126,9 +126,9 @@
 
   if (parc < 2 || !*awy2)
     {
-/* some lamers scripts continually do a /away, hence making a lot of
-   unnecessary traffic. *sigh* so... as comstud has done, I've
-   commented out this sendto_serv_butone() call -Dianora */
+      /* some lamers scripts continually do a /away, hence making a lot of
+	 unnecessary traffic. *sigh* so... as comstud has done, I've
+	 commented out this sendto_serv_butone() call -Dianora */
       /* now we can send this .. as long as they were away before
 	 away messages can get out of sync, but it's much less load
 	 on the network -is */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_links.c ircd-hybrid-6.0/src/m_links.c
--- ircd-hybrid-6.0.orig/src/m_links.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_links.c	Mon Jul  2 18:04:50 2001
@@ -29,6 +29,7 @@
 #include "numeric.h"
 #include "s_serv.h"
 #include "send.h"
+#include "s_conf.h"
 
 #include <assert.h>
 #include <string.h>
@@ -103,6 +104,7 @@
 {
   const char*    mask = "";
   struct Client* acptr;
+  struct ConfItem* aconf;
   char           clean_mask[2 * HOSTLEN + 4];
   char*          p;
   int            bogus_server = 0;
@@ -183,9 +185,14 @@
 			"LINKS '%s' requested by %s (%s@%s) [%s]",
 			mask, sptr->name, sptr->username,
 			sptr->host, sptr->user->server);
-  
-  for (acptr = GlobalClientList; acptr; acptr = acptr->next) 
+
+  for (aconf = ConfigItemList; aconf; aconf = aconf->next)
     {
+      if (aconf->status != CONF_NOCONNECT_SERVER)
+	continue;
+      acptr = find_server(aconf->name);
+      if (!acptr)
+	continue;
       if (!IsServer(acptr) && !IsMe(acptr))
         continue;
       if (*mask && !match(mask, acptr->name))
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_map.c ircd-hybrid-6.0/src/m_map.c
--- ircd-hybrid-6.0.orig/src/m_map.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_map.c	Mon Jul  2 19:16:35 2001
@@ -19,26 +19,14 @@
  */
 
 #include "client.h"
-#include "ircd.h"   /* GlobalClientList */
-#include "common.h" /* TRUE bleah */
+#include "ircd.h"
+#include "common.h"
 #include "numeric.h"
 #include "irc_string.h"
 #include "send.h"
-#include "s_log.h"
 #include "s_conf.h"
 
-#include <stdlib.h>
-#include <stdio.h>
 #include <string.h>
-#include <assert.h>
-
-/* static int map_is_hub(struct Client *acptr) */
-/* { */
-/*   return !(strlen(acptr->name) < 6  */
-/* 	   || (!strcmp(".quiet", (acptr->name)+(strlen(acptr->name)-6)))  */
-/* 	   || (!strcmp(".local", (acptr->name)+(strlen(acptr->name)-6)))); */
- 
-/* } */
 
 static char header[(MAX_MAP_DEPTH*2) + 4 + 1];
 static int header_length;
@@ -52,7 +40,8 @@
     return; /* this should never happen, but let's be safe... */
 
   /* header should be formatted for us already */
-  sendto_one(sptr, form_str(RPL_MAP), me.name, sender_prefix, header, current->name, current->ping_time);
+  sendto_one(sptr, form_str(RPL_MAP), me.name, sender_prefix, header, current->name,
+	     (current->ping_time.tv_sec * 1000) + (current->ping_time.tv_usec / 1000));
 
   /* Now, iterate over it's children */
   if (current->serv->servers)
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_message.c ircd-hybrid-6.0/src/m_message.c
--- ircd-hybrid-6.0.orig/src/m_message.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_message.c	Mon Jul  2 18:04:50 2001
@@ -452,12 +452,16 @@
    * Grrr it was pointed out to me that x@service is valid
    * for non-opers too, and wouldn't allow for flooding/stalking
    * -Dianora
+   *
+   * Valid or not, @servername is unacceptable, it reveals what server
+   * a person is on. Auspexen only.
+   *  -- asuffield
    */
 
         
   /*
   ** the following two cases allow masks in NOTICEs
-  ** (for OPERs only)
+  ** (for OPERs only) (with +M -- asuffield)
   **
   ** Armin, 8Jun90 (gruner@informatik.tu-muenchen.de)
   */
@@ -509,11 +513,24 @@
     {
       int count = 0;
 
+      /* Disable the whole farping mess for non-auspexen
+       *  -- asuffield
+       */
+      if (!IsSetOperAuspex(sptr))
+        {
+          sendto_one(sptr, form_str(ERR_NOSUCHNICK),
+                     me.name, parv[0], nick);
+ 	  msgs++;
+	  continue;
+        }
+
       /* Disable the user%host@server form for non-opers
        * -Dianora
        */
 
-      if( (char *)strchr(nick,'%') /* && !Is??????(sptr) disabled until we figure out what this is for -- asuffield */)
+      /* Disabled. This isn't very useful and I don't feel like mucking around with privs for it
+       *  -- asuffield */
+      if((char *)strchr(nick,'%'))
         {
           sendto_one(sptr, form_str(ERR_NOSUCHNICK),
                      me.name, parv[0], nick);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_ping.c ircd-hybrid-6.0/src/m_ping.c
--- ircd-hybrid-6.0.orig/src/m_ping.c	Fri Jul 30 04:25:51 1999
+++ ircd-hybrid-6.0/src/m_ping.c	Mon Jul  2 18:04:50 2001
@@ -116,8 +116,11 @@
   if (!EmptyString(destination) && irccmp(destination, me.name) != 0)
     {
       if ((acptr = find_server(destination)))
-        sendto_one(acptr,":%s PING %s :%s", parv[0],
-                   origin, destination);
+	{
+	  gettimeofday(&acptr->ping_send_time, NULL);
+	  sendto_one(acptr,":%s PING %s :%s", parv[0],
+		     origin, destination);
+	}
       else
         {
           sendto_one(sptr, form_str(ERR_NOSUCHSERVER),
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_pong.c ircd-hybrid-6.0/src/m_pong.c
--- ircd-hybrid-6.0.orig/src/m_pong.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_pong.c	Mon Jul  2 19:17:33 2001
@@ -114,7 +114,16 @@
 
   origin = parv[1];
   destination = parv[2];
-  cptr->ping_time = CurrentTime - cptr->ping_send_time;
+  {
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    sptr->ping_time.tv_sec = tv.tv_sec - sptr->ping_send_time.tv_sec;
+    sptr->ping_time.tv_usec = tv.tv_usec - sptr->ping_send_time.tv_usec;
+    if (IsServer(sptr))
+      {
+	sendto_serv_butone(cptr, ":%s SPINGTIME %s %d", me.name, sptr->name, (sptr->ping_time.tv_sec * 1000000) + sptr->ping_time.tv_usec);
+      }
+  }
   cptr->flags &= ~FLAGS_PINGSENT;
   sptr->flags &= ~FLAGS_PINGSENT;
 
@@ -127,6 +136,8 @@
           sendto_ops_flag_butone(cptr, UMODE_SEEROUTING, "%s acknowledged end of %s burst (%i sec)",
 					 sptr->name, &me.name, CurrentTime - sptr->firsttime);
 	  sendto_ops_flag_butflag_butone_hidefrom(cptr, UMODE_SERVNOTICE, UMODE_SEEROUTING, "Burst complete, %s has linked", sptr->name);
+	  /* Zero this to force another ping, to get a realistic ping time recorded */
+	  cptr->ping_send_time.tv_sec = 0;
         }
       got_server_pong = 1;
     }
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_quit.c ircd-hybrid-6.0/src/m_quit.c
--- ircd-hybrid-6.0.orig/src/m_quit.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_quit.c	Mon Jul  2 18:04:50 2001
@@ -107,13 +107,16 @@
   int i;
 
   buf[0] = '\0';
-  if (strlen(parv[1]) > MAX_QUIT_LENGTH)
-    parv[1][MAX_QUIT_LENGTH] = '\0';
-  if ((parc > 1) && parv[1])
+  if (parv[1])
     {
-      strcpy(buf, "\"");
-      strcat(buf, strip_colour(parv[1]));
-      strcat(buf, "\"");
+      if (strlen(parv[1]) > MAX_QUIT_LENGTH)
+	parv[1][MAX_QUIT_LENGTH] = '\0';
+      if ((parc > 1) && parv[1])
+	{
+	  strcpy(buf, "\"");
+	  strcat(buf, strip_colour(parv[1]));
+	  strcat(buf, "\"");
+	}
     }
   sptr->flags |= FLAGS_NORMALEX;
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_spingtime.c ircd-hybrid-6.0/src/m_spingtime.c
--- ircd-hybrid-6.0.orig/src/m_spingtime.c	Thu Jan  1 01:00:00 1970
+++ ircd-hybrid-6.0/src/m_spingtime.c	Mon Jul  2 19:17:19 2001
@@ -0,0 +1,123 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/m_pong.c
+ *   Copyright (C) 1990 Jarkko Oikarinen and
+ *                      University of Oulu, Computing Center
+ *
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers. 
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   $Id: 164-50-misc.patch,v 1.2 2001/07/16 18:55:39 lilo dead $
+ */
+#include "m_commands.h"
+#include "client.h"
+#include "ircd.h"
+#include "send.h"
+#include "numeric.h"
+
+#include <stdlib.h>
+
+/*
+ * m_functions execute protocol messages on this server:
+ *
+ *      cptr    is always NON-NULL, pointing to a *LOCAL* client
+ *              structure (with an open socket connected!). This
+ *              identifies the physical socket where the message
+ *              originated (or which caused the m_function to be
+ *              executed--some m_functions may call others...).
+ *
+ *      sptr    is the source of the message, defined by the
+ *              prefix part of the message if present. If not
+ *              or prefix not found, then sptr==cptr.
+ *
+ *              (!IsServer(cptr)) => (cptr == sptr), because
+ *              prefixes are taken *only* from servers...
+ *
+ *              (IsServer(cptr))
+ *                      (sptr == cptr) => the message didn't
+ *                      have the prefix.
+ *
+ *                      (sptr != cptr && IsServer(sptr) means
+ *                      the prefix specified servername. (?)
+ *
+ *                      (sptr != cptr && !IsServer(sptr) means
+ *                      that message originated from a remote
+ *                      user (not local).
+ *
+ *              combining
+ *
+ *              (!IsServer(sptr)) means that, sptr can safely
+ *              taken as defining the target structure of the
+ *              message in this server.
+ *
+ *      *Always* true (if 'parse' and others are working correct):
+ *
+ *      1)      sptr->from == cptr  (note: cptr->from == cptr)
+ *
+ *      2)      MyConnect(sptr) <=> sptr == cptr (e.g. sptr
+ *              *cannot* be a local connection, unless it's
+ *              actually cptr!). [MyConnect(x) should probably
+ *              be defined as (x == x->from) --msa ]
+ *
+ *      parc    number of variable parameter strings (if zero,
+ *              parv is allowed to be NULL)
+ *
+ *      parv    a NULL terminated list of parameter pointers,
+ *
+ *                      parv[0], sender (prefix string), if not present
+ *                              this points to an empty string.
+ *                      parv[1]...parv[parc-1]
+ *                              pointers to additional parameters
+ *                      parv[parc] == NULL, *always*
+ *
+ *              note:   it is guaranteed that parv[0]..parv[parc-1] are all
+ *                      non-NULL pointers.
+ */
+
+/*
+** m_spingtime
+**      parv[0] = sender prefix
+**      parv[1] = server
+**      parv[2] = ping time (in us)
+*/
+int     m_spingtime(struct Client *cptr,
+		    struct Client *sptr,
+		    int parc,
+		    char *parv[])
+{
+  struct Client *acptr;
+  
+  if (!IsServer(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_UNKNOWNCOMMAND),
+		 me.name, parv[0], "SPINGTIME");
+      return 0;
+    }
+
+  if (parc < 3)
+    return 0;
+
+  if (!(acptr = find_server(parv[1])))
+    return 0;
+
+  acptr->ping_time.tv_sec = 0;
+  acptr->ping_time.tv_usec = atoi(parv[2]);
+
+  sendto_ops_flag(UMODE_DEBUG, "Using SPINGTIME for %s from %s", parv[1], parv[0]);
+  sendto_serv_butone(cptr, ":%s SPINGTIME %s %s", parv[0], parv[1], parv[2]);
+
+  return 0;
+}
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_whois.c ircd-hybrid-6.0/src/m_whois.c
--- ircd-hybrid-6.0.orig/src/m_whois.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/m_whois.c	Mon Jul  2 18:04:50 2001
@@ -140,12 +140,13 @@
 
   if(parc > 2)
     {
-      /* Let's remove remote WHOIS entirely. It no longer has any use
+      /* Let's remove user remote WHOIS entirely. It no longer has any use
        *  -- asuffield
        */
-/*       if (hunt_server(cptr,sptr,":%s WHOIS %s :%s", 1,parc,parv) != */
-/*           HUNTED_ISME) */
-/*         return 0; */
+      if (!MyConnect(sptr))
+	if (hunt_server(cptr,sptr,":%s WHOIS %s :%s", 1,parc,parv) !=
+	    HUNTED_ISME)
+	  return 0;
       parv[1] = parv[2];
     }
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages_cust.tab ircd-hybrid-6.0/src/messages_cust.tab
--- ircd-hybrid-6.0.orig/src/messages_cust.tab	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/messages_cust.tab	Mon Jul  2 19:23:45 2001
@@ -417,7 +417,7 @@
 /* 374 RPL_ENDOFINFO, */        ":%s 374 %s :End of /INFO list.",
 /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
 /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
-/* 377 RPL_MAP, */              ":%s 377 %s %s%s (ping %ds)",
+/* 377 RPL_MAP, */              ":%s 377 %s %s%s (last ping %d ms)",
 /* 378 RPL_ENDOFMAP */          ":%s 378 %s :End of /MAP list.",
 /* 379 RPL_FORWARD */           ":%s 379 %s :Forwarding from %s to %s",
 /* 380 */       (char *)NULL,
@@ -531,7 +531,7 @@
 /* 485 ERR_USERISIMMUNE, */     ":%s 485 %s %s %s :User is immune from kick/deop",
 /* 486 ERR_RESTRICTED */        ":%s 486 %s :You are restricted and cannot chanop others",
 /* 487 ERR_NO_OP_STPLIT */      ":%s 487 %s :Due to a network split, you can not obtain channel operator status in a new channel at this time.",
-/* 488 */       (char *)NULL,
+/* 488 ERR_NEED_UMODE */        ":%s 488 %s :You have no %c umode",
 /* 489 */       (char *)NULL,
 /* 490 */       (char *)NULL,
 /* 491 ERR_NOOPERHOST, */       ":%s 491 %s :You don't have an O-line for the host you're on.",
@@ -570,8 +570,8 @@
 /* 003 STR_ADD_BAD_BAN_TYPE */  "add_id() called with unknown ban type %d!",
 /* 004 STR_DEL_BAD_BAN_TYPE */  "del_id() called with unknown ban type %d!",
 /* 005 STR_REMOTE_WILD_WHOIS */ "WTF: Remote wild WHOIS %s %s from %s",
-/* 006 */       (char *)NULL,
-/* 007 */       (char *)NULL,
+/* 006 STR_NO_SERV */           "WTF: Server %s has no serv structure",
+/* 007 STR_MISSED_UTIME */      "Got 2 TSPONGs but no UTIME during TSDELTA calculation",
 /* 008 */       (char *)NULL,
 /* 009 */       (char *)NULL,
 /* 010 */       (char *)NULL,
@@ -670,10 +670,10 @@
 /* 103 STR_BOT_WARN */          "User %s (%s@%s) is a possible spambot",
 /* 104 STR_BOT_WARN_JOIN */     "User %s (%s@%s) trying to join %s is a possible spambot",
 /* 105 STR_KICK_SPY */          "KICK by %s on %s, target %s",
-/* 106 */       (char *)NULL,
-/* 107 */       (char *)NULL,
-/* 108 */       (char *)NULL,
-/* 109 */       (char *)NULL,
+/* 106 STR_TSDELTA_ME */        ":%s NOTICE %s :Time delta from me to myself is 0 (oddly)",
+/* 107 STR_TSDELTA_SPY */       "%s requested TSDELTA calculation with %s",
+/* 108 STR_TSDELTA_RUNNING */   ":%s NOTICE %s :Already processing a TSDELTA for %s",
+/* 109 STR_TSDELTA */           "Delta to %s is roughly %d ms, with an RTT of roughly %d ms",
 /* 110 */       (char *)NULL,
 /* 111 */       (char *)NULL,
 /* 112 */       (char *)NULL,
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_conf.c ircd-hybrid-6.0/src/s_conf.c
--- ircd-hybrid-6.0.orig/src/s_conf.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/s_conf.c	Mon Jul  2 18:04:50 2001
@@ -304,8 +304,7 @@
 #endif
                          name,
                          port,
-                         get_conf_class(tmp),
-                         oper_flags_as_string(tmp->default_umodes));
+                         get_conf_class(tmp));
             else
               sendto_one(sptr, form_str(p->rpl_stats), me.name,
                          sptr->name, c,
@@ -2523,6 +2522,16 @@
 	    if (aconf->status & (CONF_CONNECT_SERVER | CONF_NOCONNECT_SERVER))
 	      {
 		u_int32_t other = (aconf->status == CONF_CONNECT_SERVER) ? CONF_NOCONNECT_SERVER : CONF_CONNECT_SERVER;
+		if (!aconf->name)
+		  {
+		    /* Somebody wrote a really *DUMB* C/N line. It doesn't *have* the field where the server name
+		     * is supposed to go. Bail, this will segfault horribly if we let it through
+		     *  -- asuffield
+		     */
+		    log(L_CRIT, "Horribly malformed %c:line detected (no server name)", 
+			(aconf->status == CONF_CONNECT_SERVER) ? 'C' : 'N');
+		    exit(-5);
+		  }
 
 		/* OK, is the partner C/N line to this one already inserted? If so, don't bother sorting, just shove it in */
 		for(aconf2 = ConfigItemList; aconf2 && !((aconf2->status == other) && (strcmp(aconf2->name, aconf->name) == 0));
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_serv.c ircd-hybrid-6.0/src/s_serv.c
--- ircd-hybrid-6.0.orig/src/s_serv.c	Mon Jul  2 19:25:52 2001
+++ ircd-hybrid-6.0/src/s_serv.c	Mon Jul  2 18:04:50 2001
@@ -900,6 +900,7 @@
 #endif /* ZIP_LINKS */
 
   /* Always send a PING after connect burst is done */
+  gettimeofday(&cptr->ping_send_time, NULL);
   sendto_one(cptr, "PING :%s", me.name);
 
 #ifdef NEED_SPLITCODE
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/tsdelta.c ircd-hybrid-6.0/src/tsdelta.c
--- ircd-hybrid-6.0.orig/src/tsdelta.c	Thu Jan  1 01:00:00 1970
+++ ircd-hybrid-6.0/src/tsdelta.c	Mon Jul  2 19:16:15 2001
@@ -0,0 +1,278 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/tsdelta.c
+ *   This file is copyright (C) 2001 Andrew Suffield
+ *                                    <asuffield@users.sourceforge.net>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+#include "config.h"
+
+#ifdef TSDELTA
+
+#include "client.h"
+#include "ircd.h"
+#include "common.h"
+#include "numeric.h"
+#include "irc_string.h"
+#include "send.h"
+#include "s_serv.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * m_functions execute protocol messages on this server:
+ *
+ *      cptr    is always NON-NULL, pointing to a *LOCAL* client
+ *              structure (with an open socket connected!). This
+ *              identifies the physical socket where the message
+ *              originated (or which caused the m_function to be
+ *              executed--some m_functions may call others...).
+ *
+ *      sptr    is the source of the message, defined by the
+ *              prefix part of the message if present. If not
+ *              or prefix not found, then sptr==cptr.
+ *
+ *              (!IsServer(cptr)) => (cptr == sptr), because
+ *              prefixes are taken *only* from servers...
+ *
+ *              (IsServer(cptr))
+ *                      (sptr == cptr) => the message didn't
+ *                      have the prefix.
+ *
+ *                      (sptr != cptr && IsServer(sptr) means
+ *                      the prefix specified servername. (?)
+ *
+ *                      (sptr != cptr && !IsServer(sptr) means
+ *                      that message originated from a remote
+ *                      user (not local).
+ *
+ *              combining
+ *
+ *              (!IsServer(sptr)) means that, sptr can safely
+ *              taken as defining the target structure of the
+ *              message in this server.
+ *
+ *      *Always* true (if 'parse' and others are working correct):
+ *
+ *      1)      sptr->from == cptr  (note: cptr->from == cptr)
+ *
+ *      2)      MyConnect(sptr) <=> sptr == cptr (e.g. sptr
+ *              *cannot* be a local connection, unless it's
+ *              actually cptr!). [MyConnect(x) should probably
+ *              be defined as (x == x->from) --msa ]
+ *
+ *      parc    number of variable parameter strings (if zero,
+ *              parv is allowed to be NULL)
+ *
+ *      parv    a NULL terminated list of parameter pointers,
+ *
+ *                      parv[0], sender (prefix string), if not present
+ *                              this points to an empty string.
+ *                      parv[1]...parv[parc-1]
+ *                              pointers to additional parameters
+ *                      parv[parc] == NULL, *always*
+ *
+ *              note:   it is guaranteed that parv[0]..parv[parc-1] are all
+ *                      non-NULL pointers.
+ */
+
+/*
+ * m_tsdelta
+ *      parv[0] = sender prefix
+ *      parv[1] = target server
+ *      parv[2] = source server
+ */
+
+int m_tsdelta(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+  struct Client* acptr;
+
+  if (!CanDoExperimental(sptr))
+    {
+      if (SeesOperMessages(sptr))
+	sendto_one(sptr, form_str(ERR_NEED_UMODE), me.name, parv[0], 'X');
+      else
+	sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]);
+      return 0;
+    }
+
+  if (parc < 2)
+    if(MyClient(sptr))
+      {
+	sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+		   me.name, parv[0], "TSDELTA");
+	return 0;
+      }
+
+  if (hunt_server(cptr, sptr,
+                  ":%s TSDELTA %s :%s", 2, parc, parv) != HUNTED_ISME)
+    return 0;
+
+  for (acptr = GlobalClientList; (acptr = next_client(acptr, parv[1]));
+       acptr = acptr->next)
+    if (IsServer(acptr) || IsMe(acptr))
+      break;
+
+  if (IsMe(acptr))
+    {
+      sendto_one(sptr, get_str(STR_TSDELTA_ME), me.name, parv[0]);
+      return 0;
+    }
+
+  if (acptr->serv->tsd_state != 0)
+    {
+      sendto_one(sptr, get_str(STR_TSDELTA_RUNNING), me.name, parv[0], acptr->name);
+      return 0;
+    }
+
+  sendto_ops_flag(UMODE_SPY, get_str(STR_TSDELTA_SPY), sptr->name, acptr->name);
+
+  sendto_one(acptr, ":%s TSDPING %s", me.name, acptr->name);
+  sendto_one(acptr, ":%s UTIME %s", me.name, acptr->name);
+  sendto_one(acptr, ":%s TSDPING %s", me.name, acptr->name);
+  acptr->serv->tsd_state = 1;
+
+  return 0;
+}
+
+int m_tsdping(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+  if (!IsServer(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_UNKNOWNCOMMAND),
+		 me.name, parv[0], "TSDPING");
+      return 0;
+    }
+
+  if (hunt_server(cptr,sptr,":%s TSDPING :%s",1,parc,parv) == HUNTED_ISME)
+    sendto_one(sptr, ":%s TSDPONG %s", me.name, parv[0]);
+
+  return 0;
+}
+
+int m_tsdpong(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+  if (!IsServer(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_UNKNOWNCOMMAND),
+		 me.name, parv[0], "TSDPING");
+      return 0;
+    }
+
+  if (hunt_server(cptr,sptr,":%s TSDPONG :%s",1,parc,parv) != HUNTED_ISME)
+    return 0;
+
+  if (!sptr->serv)
+    {
+      sendto_ops_flag(UMODE_DEBUG, get_str(STR_NO_SERV), sptr->name);
+      return 0;
+    }
+
+  switch(sptr->serv->tsd_state)
+    {
+    case 1:
+      gettimeofday(&sptr->serv->tsdpong_recv, NULL);
+      sptr->serv->tsd_state = 2;
+      break;
+    case 2:
+      sendto_ops_flag(UMODE_DEBUG, get_str(STR_MISSED_UTIME), sptr->name);
+      sptr->serv->tsd_state = 0;
+      break;
+    case 3:
+      {
+	struct timeval tv;
+	/* We take off the time for the first pong to remove any constant factors (not perfect, but good enough) */
+	/* Note that this means I don't care when I originally sent the messages */
+	long int effective_pong; /* This is the time to get the response for the 3rd pong - that of the 1st */
+	long int effective_utime_recv; /* Same idea */
+	long int rtt;    /* RTT is then roughly the difference between the two effective times */
+	long int time_delta;
+
+	gettimeofday(&tv, NULL);
+
+	/* Yes, I know these calculations could be more accurate if I stayed in us instead of going to ms.
+	 * No, I don't care. There's plenty of inaccuracy in the network latency already
+	 *  -- asuffield
+	 */
+	effective_pong = ((tv.tv_sec - sptr->serv->tsdpong_recv.tv_sec) * 1000)
+	  + ((tv.tv_usec - sptr->serv->tsdpong_recv.tv_usec) / 1000);
+	effective_utime_recv = ((sptr->serv->utime_recv.tv_sec - sptr->serv->tsdpong_recv.tv_sec) * 1000) 
+	  + ((sptr->serv->utime_recv.tv_usec - sptr->serv->tsdpong_recv.tv_usec) / 1000);
+
+	rtt = effective_pong - effective_utime_recv;
+	time_delta = ((sptr->serv->utime_recv.tv_sec - sptr->serv->utime_got.tv_sec) * 1000) 
+	  + ((sptr->serv->utime_recv.tv_usec - sptr->serv->utime_got.tv_usec) / 1000)
+	  - rtt;
+	
+	sendto_ops_flag(UMODE_EXPERIMENTAL, get_str(STR_TSDELTA), sptr->name, time_delta, rtt);
+	sptr->serv->tsd_state = 0;
+      }
+    }
+  return 0;
+}
+
+/*
+ * m_tsdelta
+ *      parv[0] = sender prefix
+ *      parv[1] = target server
+ *      parv[2] = time in secs
+ *      parv[3] = time in usecs
+ */
+
+int m_utime(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+  struct timeval tv;
+
+  if (!IsServer(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_UNKNOWNCOMMAND),
+		 me.name, parv[0], "UTIME");
+      return 0;
+    }
+
+  /* Gah. Do I need to do this in 2 forms? Not sure. Easier to just do it than to go figure
+   * the internals of hunt_server and sendto_* 
+   *  -- asuffield
+   */
+  if (parc == 4)
+    if (hunt_server(cptr,sptr,":%s UTIME %s %s %s",1,parc,parv) != HUNTED_ISME)
+      return 0;
+  if (parc == 2)
+    if (hunt_server(cptr,sptr,":%s UTIME %s",1,parc,parv) != HUNTED_ISME)
+      return 0;
+
+  if (parc > 3)
+    {
+      /* It's a time response */
+      if (IsServer(sptr) && sptr->serv && sptr->serv->tsd_state == 2)
+	{
+	  gettimeofday(&sptr->serv->utime_recv, NULL);
+	  sptr->serv->utime_got.tv_sec = atoi(parv[2]);
+	  sptr->serv->utime_got.tv_usec = atoi(parv[3]);
+	  sptr->serv->tsd_state = 3;
+	}
+    }
+  else
+    {
+      gettimeofday(&tv, NULL);
+      sendto_one(sptr, ":%s UTIME %s %d %d", me.name, parv[0], 
+		 tv.tv_sec, tv.tv_usec);
+    }
+
+  return 0;
+}
+
+#endif
