Unverified Commit e1da7241 authored by gx's avatar gx Committed by GitHub
Browse files

Fix local clients detection (#11664)

Match 127.0.0.0/8 instead of just `127.0.0.1` to detect the local clients.
parent aee8d1ff
...@@ -341,7 +341,7 @@ static int connSocketIsLocal(connection *conn) { ...@@ -341,7 +341,7 @@ static int connSocketIsLocal(connection *conn) {
if (connSocketAddr(conn, cip, sizeof(cip) - 1, NULL, 1) == C_ERR) if (connSocketAddr(conn, cip, sizeof(cip) - 1, NULL, 1) == C_ERR)
return -1; 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) { static int connSocketListen(connListener *listener) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment