1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 12:23:14 +02:00

Fix server token assignment of servers in the network

1. the directly linked server, our upstream, always has token "1", and
2. for remote servers in the network, the token and description filds
   were interchanged during registration,

therefore up to now no server could be found by Server::Find() using its
assigned server token.
This commit is contained in:
Alexander Barton
2014-11-30 21:46:50 +01:00
parent 0cdab86978
commit 95684187b6
+6 -7
View File
@@ -524,18 +524,17 @@ struct IRCDMessageServer : IRCDMessage
IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
/*
* New directly linked server:
*
* SERVER tolsun.oulu.fi 1 :Experimental server
* New server tolsun.oulu.fi introducing itself
* and attempting to register.
*
* RFC 2813 says the server has to send a hopcount
* AND a servertoken. Not quite sure what ngIRCd is
* sending here.
*
* params[0] = servername
* params[1] = hop count (or servertoken?)
* params[1] = hop count
* params[2] = server description
*
* New remote server in the network:
*
* :tolsun.oulu.fi SERVER csd.bu.edu 5 34 :BU Central Server
* Server tolsun.oulu.fi is our uplink for csd.bu.edu
@@ -554,13 +553,13 @@ struct IRCDMessageServer : IRCDMessage
if (params.size() == 3)
{
// our uplink is introducing itself
new Server(Me, params[0], 1, params[2], "");
new Server(Me, params[0], 1, params[2], "1");
}
else
{
// our uplink is introducing a new server
unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
new Server(source.GetServer(), params[0], hops, params[2], params[3]);
new Server(source.GetServer(), params[0], hops, params[3], params[2]);
}
/*
* ngIRCd does not send an EOB, so we send a PING immediately