X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_nick.c;h=b8cf167b593f2bee876ef5eb352c5d49893f520d;hb=f17f0487c981da8c0c2b450fff45f13fd481a176;hp=59785621e86a97584ec0402e6435774b0bd60188;hpb=8079138defb64c4d8955d9eb974466cd275965c5;p=ircu2.10.12-pk.git diff --git a/ircd/m_nick.c b/ircd/m_nick.c index 5978562..b8cf167 100644 --- a/ircd/m_nick.c +++ b/ircd/m_nick.c @@ -217,7 +217,6 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; - ip_registry_connect_fail(acptr->ip.s_addr); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } @@ -385,7 +384,6 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; - ip_registry_connect_fail(acptr->ip.s_addr); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } @@ -605,13 +603,20 @@ int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) * is present in the nicklist (due to the way the below for loop is * constructed). -avalon */ - if ((acptr = FindServer(nick))) { + + acptr = FindServer(nick); + + if (acptr) { /* There is a nick collision with a server */ if (MyConnect(sptr)) { + /* Local user trying to use a nick thats a server + * Return an error message and ignore the command + */ sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */ EmptyString(parv[0]) ? "*" : parv[0], nick); return 0; /* NICK message ignored */ } + /* * We have a nickname trying to use the same name as * a server. Send out a nick collision KILL to remove @@ -628,9 +633,12 @@ int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) sptr->flags |= FLAGS_KILLED; return exit_client(cptr, sptr, &me, "Nick/Server collision"); } + + acptr = FindClient(nick); - if (!(acptr = FindClient(nick))) - return set_nick_name(cptr, sptr, nick, parc, parv); /* No collisions, all clear... */ + /* No collisions? Set the nick name and we're done */ + if (!acptr) + return set_nick_name(cptr, sptr, nick, parc, parv); /* * If acptr == sptr, then we have a client doing a nick * change between *equivalent* nicknames as far as server @@ -668,7 +676,6 @@ int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; - ip_registry_connect_fail(acptr->ip.s_addr); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); }