From e803b780f44d76cf3cb5ab4658e9841d589f48f1 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Apr 2004 21:20:05 +0000 Subject: Added connection version checking git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@653 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 00e831b66..dc57048b1 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -6993,9 +6993,20 @@ void handle_link_packet(char* udp_msg, char* udp_host, serverrec *serv) char* servername = strtok(params," "); char* password = strtok(NULL," "); char* myport = strtok(NULL," "); + char* revision = strtok(NULL," "); char* serverdesc = finalparam+2; + WriteOpers("CONNECT from %s (%s) (their port: %d)",servername,udp_host,atoi(myport)); + if (atoi(revision) != GetRevision()) + { + WriteOpers("Could not link to %s, is an incompatible version %s, our version is %d",servername,revision,GetRevision()); + char buffer[MAXBUF]; + sprintf(buffer,"E :Version number mismatch"); + serv->SendPacket(buffer,udp_host); + return; + } + for (int j = 0; j < serv->connectors.size(); j++) { if (!strcasecmp(serv->connectors[j].GetServerName().c_str(),udp_host)) -- cgit v1.2.3