While implementing apass1-2, my eye fell on m_create.
It seems that what happens there should be changed.

The code currently is:

int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
...
  if (IsServer(sptr))
    return protocol_violation(sptr,"%s tried to CREATE a channel", cli_name(sptr));
...
  chanTS = atoi(parv[2]);
...
  /* A create that didn't appear during a burst has that servers idea of
   * the current time.  Use it for lag calculations.
   */
  if (!IsBurstOrBurstAck(sptr) && 0 != chanTS &&
      MAGIC_REMOTE_JOIN_TS != chanTS)
    cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS;
...
  /* If this server is >1 minute fast, warn */
  if (TStime() - chanTS<-60) {
...
    /* If this server is >5 minutes fast, squit it */
    if (TStime() - chanTS<-5*60*60)
      return exit_client(sptr, sptr, &me, "Timestamp Drift/Bogus TS");
  }
...

Firstly, the last exit_client KILLs sptr, a client.  It doesn't SQUIT
the server of sptr.  But changing this into squitting the server of
sptr would be at least as wrong - consider:

A <-- 5 minutes lag --> B - C - D - E - F - G
                                 \- H - I - J

Where 'A' is a laggy server that just got connected.
Now a client on the other side of the well-working network
(on 'G' say) creates a new channel.  Its CREATE is forwarded
to F, E, and so on.

When the CREATE reaches A, server A will KILL the client on G,
or SQUIT 'G' according to the comment in the code.
That can't be right.  It should at _most_ SQUIT B.

-- 
Carlo Wood <[EMAIL PROTECTED]>

Reply via email to