X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/c3915bdcd99a53975f47c56063602f0891999ce5..ec8177c5c7b355a953871d6fded9ae77cf2a4a96:/src/proto-p10.c diff --git a/src/proto-p10.c b/src/proto-p10.c index 72ec7d4..3074fad 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -80,6 +80,7 @@ #define CMD_PROTO "PROTO" #define CMD_QUIT "QUIT" #define CMD_REHASH "REHASH" +#define CMD_REMOVE "REMOVE" #define CMD_RESET "RESET" #define CMD_RESTART "RESTART" #define CMD_RPING "RPING" @@ -121,6 +122,7 @@ #define CMD_WHO "WHO" #define CMD_WHOIS "WHOIS" #define CMD_WHOWAS "WHOWAS" +#define CMD_ZLINE "ZLINE" /* Tokenized commands. */ #define TOK_ACCOUNT "AC" @@ -177,6 +179,7 @@ #define TOK_PROTO "PROTO" #define TOK_QUIT "Q" #define TOK_REHASH "REHASH" +#define TOK_REMOVE "RM" #define TOK_RESET "RESET" #define TOK_RESTART "RESTART" #define TOK_RPING "RI" @@ -218,6 +221,7 @@ #define TOK_WHO "H" #define TOK_WHOIS "W" #define TOK_WHOWAS "X" +#define TOK_ZLINE "ZL" /* Protocol messages; aliased to full commands or tokens depending on compile-time configuration. ircu prefers tokens WITH THE @@ -283,6 +287,7 @@ #define P10_PROTO TYPE(PROTO) #define P10_QUIT TYPE(QUIT) #define P10_REHASH TYPE(REHASH) +#define P10_REMOVE TYPE(REMOVE) #define P10_RESET TYPE(RESET) #define P10_RESTART TYPE(RESTART) #define P10_RPING TYPE(RPING) @@ -323,6 +328,7 @@ #define P10_WHO TYPE(WHO) #define P10_WHOIS TYPE(WHOIS) #define P10_WHOWAS TYPE(WHOWAS) +#define P10_ZLINE TYPE(ZLINE) #define P10_EXEMPT TYPE(EXEMPT) /* Servers claiming to have a boot or link time before PREHISTORY @@ -514,7 +520,7 @@ irc_p10_pton(irc_in_addr_t *ip, const char *input) do { if (*input == '_') { unsigned int left; - for (left = (25 - strlen(input)) / 3; left; left--) + for (left = (25 - strlen(input)) / 3 - pos; left; left--) ip->in6[pos++] = 0; input++; } else { @@ -1247,7 +1253,7 @@ static CMD_FUNC(cmd_whois) else irc_numeric(from, RPL_WHOISUSER, "%s %s %s * :%s", who->nick, who->ident, who->hostname, who->info); - if (IsService(who) || (from == who)) { + if (!IsService(who) || (from == who)) { struct modeNode *mn; mlen = strlen(self->name) + strlen(from->nick) + 12 + strlen(who->nick); len = 0; @@ -2700,6 +2706,11 @@ init_parse(void) /* We have reliable clock! Always! Wraaa! */ dict_insert(irc_func_dict, CMD_SETTIME, cmd_dummy); dict_insert(irc_func_dict, TOK_SETTIME, cmd_dummy); + /* Ignore ZLINE/ZL/REMOVE/RM */ + dict_insert(irc_func_dict, CMD_ZLINE, cmd_dummy); + dict_insert(irc_func_dict, TOK_ZLINE, cmd_dummy); + dict_insert(irc_func_dict, CMD_REMOVE, cmd_dummy); + dict_insert(irc_func_dict, TOK_REMOVE, cmd_dummy); /* ignore /trace and /motd commands targetted at us */ dict_insert(irc_func_dict, TOK_TRACE, cmd_dummy); @@ -3077,7 +3088,7 @@ AddUser(struct server* uplink, const char *nick, const char *ident, const char * tstr = conf_get_data("server/type", RECDB_QSTRING); type = atoi(tstr); - if (type > 6) { + if (type == 7) { if (irc_in_addr_is_ipv4(uNode->ip)) { make_virtip((char*)irc_ntoa(&uNode->ip), (char*)irc_ntoa(&uNode->ip), uNode->cryptip); make_virthost((char*)irc_ntoa(&uNode->ip), uNode->hostname, uNode->crypthost);