1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 09:29:52 +03:00

Log client IP in failed accesses

to be able to feed tools such as Fail2Ban
This commit is contained in:
Ben RUBSON 2020-05-11 23:09:26 +02:00 committed by GitHub
parent 8fdf7302a5
commit 3f16a7e704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2017,8 +2017,11 @@ bool ServerAccept(CONNECTION *c)
if (auth_ret == false)
{
// Get client IP to feed tools such as Fail2Ban
char ip[64];
IPToStr(ip, sizeof(ip), &c->FirstSock->RemoteIP);
// Authentication failure
HLog(hub, "LH_AUTH_NG", c->Name, username);
HLog(hub, "LH_AUTH_NG", c->Name, username, ip);
}
else
{