]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/mode.cpp
Off by one
[user/henk/code/inspircd.git] / src / mode.cpp
index 83aff70cf56400a4e64d29d89dc26cc196f65948..6805c348c8629cf7e53167dc978abea91a93d1a9 100644 (file)
@@ -705,12 +705,12 @@ void ModeParser::CleanMask(std::string &mask)
        std::string::size_type pos_of_pling = mask.find_first_of('!');
        std::string::size_type pos_of_at = mask.find_first_of('@');
        std::string::size_type pos_of_dot = mask.find_first_of('.');
-       std::string::size_type pos_of_colon = mask.find_first_of(':'); /* Because ipv6 addresses are colon delimited */
+       std::string::size_type pos_of_colons = mask.find("::"); /* Because ipv6 addresses are colon delimited -- double so it treats extban as nick */
 
        if ((pos_of_pling == std::string::npos) && (pos_of_at == std::string::npos))
        {
-               /* Just a nick, or just a host */
-               if ((pos_of_dot == std::string::npos) && (pos_of_colon == std::string::npos))
+               /* Just a nick, or just a host - or clearly ipv6 (starting with :) */
+               if ((pos_of_dot == std::string::npos) && (pos_of_colons == std::string::npos) && mask[0] != ':')
                {
                        /* It has no '.' in it, it must be a nick. */
                        mask.append("!*@*");