if (!Client_CheckID(Client, Req->argv[0]))
return DISCONNECTED;
+ if (!Req->prefix) {
+ /* We definitely need a prefix here! */
+ Log(LOG_ALERT, "Got SERVER command without prefix! (on connection %d)",
+ Client_Conn(Client));
+ Conn_Close(Client_Conn(Client), NULL,
+ "SERVER command without prefix", true);
+ return DISCONNECTED;
+ }
+
from = Client_Search( Req->prefix );
if (! from) {
/* Uh, Server, that introduced the new server is unknown?! */
{
char msg[COMMAND_LEN], logmsg[COMMAND_LEN];
CLIENT *from, *target;
- CONN_ID con;
+ CONN_ID con, client_con;
int loglevel;
assert(Client != NULL);
return CONNECTED;
}
+ client_con = Client_Conn(Client);
con = Client_Conn(target);
if (Req->argv[1][0])
Req->argv[0], Client_ID(from),
Req->argv[1][0] ? Req->argv[1] : "-");
Conn_Close(con, NULL, msg, true);
- if (con == Client_Conn(Client))
+ if (con == client_con)
return DISCONNECTED;
} else {
/* This server is not directly connected, so the SQUIT must