diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-18 21:20:05 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-18 21:20:05 +0000 |
commit | e803b780f44d76cf3cb5ab4658e9841d589f48f1 (patch) | |
tree | faae9f1288eb6ada90ae838822c52cba4c97b0a2 /src | |
parent | c04802b476db57fca3b0eea713658c889b69e425 (diff) |
Added connection version checking
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@653 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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)) |