From: Kevin L. Mitchell Date: Thu, 1 Nov 2001 22:56:51 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=a63ed96a58c1317dba4e3d6ca5bccddcc4ab379f Author: Kev 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 --- diff --git a/ChangeLog b/ChangeLog index 7c5ea3d..7fd9c17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2001-11-01 Kevin L Mitchell + + * 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 * fixed TS drift message to use sptr, not cptr diff --git a/include/send.h b/include/send.h index a37f628..1fd6421 100644 --- a/include/send.h +++ b/include/send.h @@ -9,16 +9,16 @@ #include /* va_list */ #define INCLUDED_stdarg_h #endif +#ifndef INCLUDED_time_h +#include /* 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); diff --git a/ircd/m_create.c b/ircd/m_create.c index 02cf2a5..7f8689c 100644 --- a/ircd/m_create.c +++ b/ircd/m_create.c @@ -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) diff --git a/ircd/m_ping.c b/ircd/m_ping.c index 0d6c689..82c493b 100644 --- a/ircd/m_ping.c +++ b/ircd/m_ping.c @@ -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; } diff --git a/ircd/m_squit.c b/ircd/m_squit.c index 791b4b5..67d541b 100644 --- a/ircd/m_squit.c +++ b/ircd/m_squit.c @@ -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); } - - diff --git a/ircd/send.c b/ircd/send.c index 745ba94..8f17ee6 100644 --- a/ircd/send.c +++ b/ircd/send.c @@ -481,7 +481,7 @@ void sendcmdto_channel_butone(struct Client *from, const char *cmd, * 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 - 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;