mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Fix (d)host starting with ':' for some IPv6 clients
This commit is contained in:
parent
13b7084eae
commit
4f9cc281d5
@ -230,12 +230,18 @@ LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::so
|
||||
/*
|
||||
* Initialize host and dhost here to the user's IP.
|
||||
* It is important to do this before calling SetClientIP()
|
||||
* as that can pass execution to modules that expect these
|
||||
* as that passes execution to modules that expect these
|
||||
* fields to be valid.
|
||||
*
|
||||
* We cannot call GetIPString() now as that will access
|
||||
* client_sa, and that's only initialized after the first
|
||||
* SetClientIP() call.
|
||||
*/
|
||||
|
||||
int port;
|
||||
irc::sockets::satoap(*client, host, port);
|
||||
if (host[0] == ':')
|
||||
host.insert(0, 1, '0');
|
||||
dhost = host;
|
||||
SetClientIP(*client);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user