Fix local clients detection (#11664)

Match 127.0.0.0/8 instead of just `127.0.0.1` to detect the local clients.
This commit is contained in:
gx 2023-04-04 15:45:09 +08:00 committed by GitHub
parent aee8d1ff28
commit e1da724117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,7 +341,7 @@ static int connSocketIsLocal(connection *conn) {
if (connSocketAddr(conn, cip, sizeof(cip) - 1, NULL, 1) == C_ERR)
return -1;
return !strcmp(cip,"127.0.0.1") || !strcmp(cip,"::1");
return !strncmp(cip, "127.", 4) || !strcmp(cip, "::1");
}
static int connSocketListen(connListener *listener) {