]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Spoofed prefixes: Really kill connection on non-server links
authorAlexander Barton <alex@barton.de>
Tue, 18 Mar 2014 15:27:03 +0000 (16:27 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 18 Mar 2014 15:30:38 +0000 (16:30 +0100)
This fixes commit 6cbe1308 which only killed the connection when the
spoofed prefix itself belonged to a non-server client.

src/ngircd/parse.c

index 94230c87a099c9d5eacb40016d5a6c790603ecef..28dee6fc90c374a6d087ce0a3190b7dc94be2c99 100644 (file)
@@ -342,7 +342,7 @@ Validate_Prefix( CONN_ID Idx, REQUEST *Req, bool *Closed )
        /* check if the client named in the prefix is expected
         * to come from that direction */
        if (Client_NextHop(c) != client) {
        /* check if the client named in the prefix is expected
         * to come from that direction */
        if (Client_NextHop(c) != client) {
-               if (Client_Type(c) != CLIENT_SERVER) {
+               if (Client_Type(client) != CLIENT_SERVER) {
                        Log(LOG_ERR,
                            "Spoofed prefix \"%s\" from \"%s\" (connection %d, command \"%s\"), closing connection!",
                            Req->prefix, Client_ID(client), Idx, Req->command);
                        Log(LOG_ERR,
                            "Spoofed prefix \"%s\" from \"%s\" (connection %d, command \"%s\"), closing connection!",
                            Req->prefix, Client_ID(client), Idx, Req->command);