From f1d265d177d54e508a7a7027952c1081b399ae04 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Wed, 9 Jun 2021 13:14:23 +0100 Subject: [PATCH] m_userhost: hide user's own IP if iline spoofed --- modules/m_userhost.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/m_userhost.c b/modules/m_userhost.c index 6b0a9ac1..0199f415 100644 --- a/modules/m_userhost.c +++ b/modules/m_userhost.c @@ -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 {