commit 6cbe13085d3c8767a70d2394840a0a03ac6f290a from: Alexander Barton date: Tue Jul 19 14:07:34 2011 UTC Spoofed prefixes: close connection on non-server links only On server-links, spoofed prefixes can happen because of the asynchronous nature of the IRC protocol. So don't break server-links, only log a message and ignore the command. This fixes bug 113, see: commit - b7780e3f2acb989fab7d98cb79d5f5dff65accbc commit + 6cbe13085d3c8767a70d2394840a0a03ac6f290a blob - 72e3430998b301d4011b9b55175e1a91d41875a6 blob + be3c864dc26f0683e5d39a6a6254ba4f84bdeab8 --- src/ngircd/parse.c +++ src/ngircd/parse.c @@ -325,13 +325,21 @@ Validate_Prefix( CONN_ID Idx, REQUEST *Req, bool *Clos /* check if the client named in the prefix is expected * to come from that direction */ if (Client_NextHop(c) != client) { - Log(LOG_ERR, - "Spoofed prefix \"%s\" from \"%s\" (connection %d, command \"%s\")!", - Req->prefix, Client_Mask(Conn_GetClient(Idx)), Idx, - Req->command); - Conn_Close(Idx, NULL, "Spoofed prefix", true); - *Closed = true; + if (Client_Type(c) != CLIENT_SERVER) { + Log(LOG_ERR, + "Spoofed prefix \"%s\" from \"%s\" (connection %d, command \"%s\")!", + Req->prefix, Client_Mask(Conn_GetClient(Idx)), Idx, + Req->command); + Conn_Close(Idx, NULL, "Spoofed prefix", true); + *Closed = true; + } else { + Log(LOG_INFO, + "Ignoring spoofed prefix \"%s\" from \"%s\" (connection %d, command \"%s\").", + Req->prefix, Client_Mask(Conn_GetClient(Idx)), Idx, + Req->command); + } return false; + } return true;