From: Timo Sirainen Date: Tue, 5 Jan 2016 16:08:01 +0000 (-0500) Subject: auth: Fixed allow_nets=local to work correctly with non-local remote IP X-Git-Tag: 2.2.22.rc1~380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7ff41f105ef1e7577ff0fa34554478e95efd0d4;p=thirdparty%2Fdovecot%2Fcore.git auth: Fixed allow_nets=local to work correctly with non-local remote IP --- diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index 9d9d2274c5..a61c8eb686 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -1335,12 +1335,12 @@ auth_request_validate_networks(struct auth_request *request, auth_request_log_debug(request, AUTH_SUBSYS_DB, "%s: Matching for network %s", name, *net); - if (strcmp(*net, "local") == 0 && remote_ip->family == 0) { - found = TRUE; - break; - } - - if (net_parse_range(*net, &net_ip, &bits) < 0) { + if (strcmp(*net, "local") == 0) { + if (remote_ip->family == 0) { + found = TRUE; + break; + } + } else if (net_parse_range(*net, &net_ip, &bits) < 0) { auth_request_log_info(request, AUTH_SUBSYS_DB, "%s: Invalid network '%s'", name, *net); } else if (remote_ip->family != 0 &&