X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..ae42901c540b413a5064dbec9a566627b3a2967b:/modules/m_svinfo.c diff --git a/modules/m_svinfo.c b/modules/m_svinfo.c index 9067a64..0d8d90c 100644 --- a/modules/m_svinfo.c +++ b/modules/m_svinfo.c @@ -59,6 +59,7 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char { signed int deltat; time_t theirtime; + char squitreason[120]; /* SVINFO isnt remote. */ if(source_p != client_p) @@ -70,16 +71,18 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char sendto_realops_snomask(SNO_GENERAL, L_ALL, "Link %s dropped, wrong TS protocol version (%s,%s)", get_server_name(source_p, SHOW_IP), parv[1], parv[2]); - exit_client(source_p, source_p, source_p, "Incompatible TS version"); + snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)", + parv[1], parv[2]); + exit_client(source_p, source_p, source_p, squitreason); return 0; } /* - * since we're here, might as well set CurrentTime while we're at it + * since we're here, might as well set rb_current_time() while we're at it */ set_time(); theirtime = atol(parv[4]); - deltat = abs(theirtime - CurrentTime); + deltat = abs(theirtime - rb_current_time()); if(deltat > ConfigFileEntry.ts_max_delta) { @@ -87,21 +90,23 @@ ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char "Link %s dropped, excessive TS delta" " (my TS=%ld, their TS=%ld, delta=%d)", get_server_name(source_p, SHOW_IP), - (long) CurrentTime, (long) theirtime, deltat); + (long) rb_current_time(), (long) theirtime, deltat); ilog(L_SERVER, "Link %s dropped, excessive TS delta" " (my TS=%ld, their TS=%ld, delta=%d)", - log_client_name(source_p, SHOW_IP), (long) CurrentTime, (long) theirtime, deltat); - exit_client(source_p, source_p, source_p, "Excessive TS delta"); + log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat); + snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)", + (long) rb_current_time(), (long) theirtime, deltat); + exit_client(source_p, source_p, source_p, squitreason); return 0; } if(deltat > ConfigFileEntry.ts_warn_delta) { - sendto_realops_snomask(SNO_GENERAL, L_ALL, + sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Link %s notable TS delta" " (my TS=%ld, their TS=%ld, delta=%d)", - source_p->name, (long) CurrentTime, (long) theirtime, deltat); + source_p->name, (long) rb_current_time(), (long) theirtime, deltat); } return 0;