summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-19 03:33:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-19 03:33:02 +0000
commit99caa2a956e428096fcd42d5fd3b89aeccb07491 (patch)
tree6ff691194b95bd317d1efea4fe492c3d29218105 /src
parent882c2d2e8c584544d024b168cd6a1f8512eb8d77 (diff)
Added 'server already exists' check for u-type links
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1131 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/commands.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 40edee6e2..088dabe68 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1490,7 +1490,7 @@ void handle_connect(char **parameters, int pcnt, userrec *user)
char Link_Pass[1024];
int LinkPort;
bool found = false;
-
+
for (int i = 0; i < ConfValueEnum("link",&config_f); i++)
{
if (!found)
@@ -3082,7 +3082,7 @@ void handle_link_packet(char* udp_msg, char* tcp_host, serverrec *serv)
char Link_Pass[1024];
char Link_SendPass[1024];
int LinkPort = 0;
-
+
// search for a corresponding <link> block in the config files
for (int i = 0; i < ConfValueEnum("link",&config_f); i++)
{
@@ -3150,6 +3150,26 @@ void handle_link_packet(char* udp_msg, char* tcp_host, serverrec *serv)
int LinkPort = 0;
log(DEBUG,"U-token linked server detected.");
+
+
+ for (int j = 0; j < 32; j++)
+ {
+ if (me[j] != NULL)
+ {
+ for (int k = 0; k < me[j]->connectors.size(); k++)
+ {
+ if (!strcasecmp(me[j]->connectors[k].GetServerName().c_str(),servername))
+ {
+ char buffer[MAXBUF];
+ sprintf(buffer,"E :Access is denied (Server exists in the mesh)");
+ serv->SendPacket(buffer,tcp_host);
+ WriteOpers("CONNECT from %s denied, \"%s\" already exists!",tcp_host,servername);
+ RemoveServer(tcp_host);
+ return;
+ }
+ }
+ }
+ }
// search for a corresponding <link> block in the config files
for (int i = 0; i < ConfValueEnum("link",&config_f); i++)