m_userhost: hide user's own IP if iline spoofed

This commit is contained in:
Ed Kellett 2021-06-09 13:14:23 +01:00
parent d5e424bcff
commit f1d265d177

View file

@ -76,20 +76,14 @@ m_userhost(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
if((target_p = find_person(parv[i])) != NULL)
{
/*
* Show real IP for USERHOST on yourself.
* This is needed for things like mIRC, which do a server-based
* lookup (USERHOST) to figure out what the clients' local IP
* is. Useful for things like NAT, and dynamic dial-up users.
*/
if(MyClient(target_p) && (target_p == source_p))
if (MyClient(target_p) && target_p == source_p)
{
rl = sprintf(response, "%s%s=%c%s@%s ",
target_p->name,
SeesOper(target_p, source_p) ? "*" : "",
(target_p->user->away) ? '-' : '+',
target_p->username,
target_p->sockhost);
IsIPSpoof(target_p) ? target_p->orighost : target_p->sockhost);
}
else
{