+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
#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
*/
/* 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,
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);
/* 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)
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;
}
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;
}
* 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;
}
return exit_client(cptr, acptr, sptr, comment);
}
-
-
* <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;
/* 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);
}
* 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;