Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Thu, 1 Nov 2001 22:56:51 +0000 (22:56 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Thu, 1 Nov 2001 22:56:51 +0000 (22:56 +0000)
Log message:

Keeping .12 branch in sync with fixes committed to u2.10.11.

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

ChangeLog
include/send.h
ircd/m_create.c
ircd/m_ping.c
ircd/m_squit.c
ircd/send.c

index 7c5ea3d4a7b0e32f5a37ccb370a4034df452591f..7fd9c17d08c0a3968ec8927756a6d3732c47a327 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2001-11-01  Kevin L Mitchell  <klmitch@mit.edu>
+
+       * ircd/send.c: some minor white-space fiddling; recast selector
+       test in sendwallto_group_butone() to remove a warning regarding
+       putting & within parentheses [forward-port from u2.10.11]
+
+       * ircd/m_create.c (ms_create): use time_t instead of int as a
+       declaration for rate [forward-port from u2.10.11]
+
+       * ircd/ircd_reply.c (protocol_violation): it's supposed to be
+       WALL_DESYNCH, not CMD_DESYNCH, if I understand things right--no
+       wonder we weren't seeing any protocol violations! [forward-port
+       from u2.10.11]
+
+       * include/send.h: include time.h for time_t; move WALL_* closer to
+       the function they're used in; some white-space fiddling; add
+       declaration of sendto_opmask_butone_ratelimited() [forward-port
+       from u2.10.11]
+
+       * ircd/m_squit.c (ms_squit): add protocol_violation() calls in the
+       cases where we ignore a squit, so we aren't taken by surprise, at
+       least... [forward-port from u2.10.11]
+
+       * ircd/m_create.c (ms_create): Display origin server, not origin
+       user [forward-port from u2.10.11]
+
 2001-11-02  Perry Lorier  <isomer@coders.net>
        * fixed TS drift message to use sptr, not cptr
 
index a37f628aedd3a60adade993a11471f1b1cd232c3..1fd642136d40220aada363669b7034d88c931aae 100644 (file)
@@ -9,16 +9,16 @@
 #include <stdarg.h>         /* va_list */
 #define INCLUDED_stdarg_h 
 #endif
+#ifndef INCLUDED_time_h
+#include <time.h>      /* time_t */
+#define INCLUDED_time_h
+#endif
 
 struct Channel;
 struct Client;
 struct DBuf;
 struct MsgBuf;
 
-#define WALL_DESYNCH   1
-#define WALL_WALLOPS   2
-#define WALL_WALLUSERS 3
-
 /*
  * Prototypes
  */
@@ -70,7 +70,12 @@ extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
 
 /* Send command to all users having a particular flag set */
 extern void sendwallto_group_butone(struct Client *from, int type, 
-                               struct Client *one, const char *pattern, ...);
+                                   struct Client *one, const char *pattern,
+                                   ...);
+
+#define WALL_DESYNCH   1
+#define WALL_WALLOPS   2
+#define WALL_WALLUSERS 3
 
 /* Send command to all matching clients */
 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
@@ -82,6 +87,11 @@ extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
                                 const char *pattern, ...);
 
+/* Same as above, but rate limited */
+extern void sendto_opmask_butone_ratelimited(struct Client *one,
+                                            unsigned int mask, time_t *rate,
+                                            const char *pattern, ...);
+
 /* Same as above, but with variable argument list */
 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
                                  const char *pattern, va_list vl);
index 02cf2a5aa1f7a08f8739023f37515dfae47803c3..7f8689c9b035e553e4eddc3fbd164a66c9adb828 100644 (file)
@@ -134,9 +134,11 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   /* If this server is >1 minute fast, warn */
   if (TStime() - chanTS<-60) {
-    static int rate;
-    sendto_opmask_butone_ratelimited(0,SNO_NETWORK,&rate,
-       "Timestamp drift from %C (%is)",sptr,chanTS-TStime());
+    static time_t rate;
+    sendto_opmask_butone_ratelimited(0, SNO_NETWORK, &rate,
+                                    "Timestamp drift from %C (%is)",
+                                    cli_user(sptr)->server,
+                                    chanTS - TStime());
 
     /* If this server is >5 minutes fast, squit it */
     if (TStime() - chanTS<-5*60*60)
index 0d6c689502740c0b6c75080023263b0fe7816506..82c493b9e968ce49b0564b131d76eefcd856103f 100644 (file)
@@ -161,7 +161,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (parc < 2 || EmptyString(parv[1]))
     return send_reply(sptr, ERR_NOORIGIN);
 
-  sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, origin);
+  sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, parv[1]);
   return 0;
 }
 
index 791b4b595bd069972b208ec2cdcc75dfdd3c4741..67d541bff1d15fc31b3ed57bbd4200434f068c54 100644 (file)
@@ -77,6 +77,8 @@ int ms_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     acptr = FindServer(server);
 
   if (!acptr) {
+    protocol_violation(sptr, "Issued SQUIT for unknown server %s (ignored)",
+                      server);
     Debug((DEBUG_NOTICE, "Ignoring SQUIT to an unknown server"));
     return 0;
   }
@@ -93,6 +95,9 @@ int ms_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * It will be our neighbour.
    */
   if ( timestamp != 0 && timestamp != cli_serv(acptr)->timestamp) {
+    protocol_violation(sptr, "Issued SQUIT for %C with wrong timestamp %Tu "
+                      "(%Tu) (ignored)", acptr, timestamp,
+                      cli_serv(acptr)->timestamp);
     Debug((DEBUG_NOTICE, "Ignoring SQUIT with the wrong timestamp"));
     return 0;
   }
@@ -155,5 +160,3 @@ int mo_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return exit_client(cptr, acptr, sptr, comment);
 }
-
-
index 745ba94ec6e4b03817d24d84d10d9e1f1a052a7e..8f17ee6cfbd5c07c5beb95dd85d18b966393787b 100644 (file)
@@ -481,7 +481,7 @@ void sendcmdto_channel_butone(struct Client *from, const char *cmd,
  * <flag> set.
  */
 void sendwallto_group_butone(struct Client *from, int type, struct Client *one,
-                           const char *pattern, ...)
+                            const char *pattern, ...)
 {
   struct VarData vd;
   struct Client *cptr;
@@ -516,11 +516,11 @@ void sendwallto_group_butone(struct Client *from, int type, struct Client *one,
 
   /* send buffer along! */
   for (i = 0; i <= HighestFd; i++) {
-    if (!(cptr = LocalClientArray[i]) 
-       || (cli_fd(cli_from(cptr)) < 0)
-       || (type==WALL_DESYNCH && (cli_flags(cptr)&FLAGS_DEBUG==0))
-       || (type==WALL_WALLOPS && (cli_flags(cptr)&FLAGS_WALLOP==0))
-        || (type==WALL_WALLUSERS && (cli_flags(cptr)&FLAGS_WALLOP==0)))
+    if (!(cptr = LocalClientArray[i]) ||
+       (cli_fd(cli_from(cptr)) < 0) ||
+       (type == WALL_DESYNCH && !(cli_flags(cptr) & FLAGS_DEBUG)) ||
+       (type == WALL_WALLOPS && !(cli_flags(cptr) & FLAGS_WALLOP)) ||
+        (type == WALL_WALLUSERS && !(cli_flags(cptr) & FLAGS_WALLOP)))
       continue; /* skip it */
     send_buffer(cptr, mb, 1);
   }
@@ -620,7 +620,7 @@ void sendto_opmask_butone(struct Client *one, unsigned int mask,
  * except for <one> - Ratelimited 1 / 30sec
  */
 void sendto_opmask_butone_ratelimited(struct Client *one, unsigned int mask,
-                         time_t *rate, const char *pattern, ...)
+                                     time_t *rate, const char *pattern, ...)
 {
   va_list vl;