]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-server.c
Don't accept connections for servers already beeing linked
[ngircd-alex.git] / src / ngircd / irc-server.c
index 79facf5e0ead3a639c475956cc1a34a46aa1d4fc..02e3ae824e2d9c644e7f009d49db33ac8314a8a0 100644 (file)
@@ -104,6 +104,10 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                if (!Client_CheckID(Client, Req->argv[0]))
                        return DISCONNECTED;
 
+               /* Mark this connection as belonging to an configured server */
+               if (!Conf_SetServer(i, Client_Conn(Client)))
+                       return DISCONNECTED;
+
                Client_SetID( Client, Req->argv[0] );
                Client_SetHops( Client, 1 );
                Client_SetInfo( Client, Req->argv[Req->argc - 1] );
@@ -131,9 +135,6 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                        Client_SetToken(Client, atoi(Req->argv[1]));
                }
 
-               /* Mark this connection as belonging to an configured server */
-               Conf_SetServer(i, Client_Conn(Client));
-
                /* Check protocol level */
                if (Client_Type(Client) == CLIENT_GOTPASS) {
                        /* We got a "simple" PASS command, so the peer is