changeset 19540:f8d2dded6aa0

auth: Fixed allow_nets=local to work correctly with non-local remote IP
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 05 Jan 2016 11:08:01 -0500
parents 504104af673f
children af2ddcf54f92
files src/auth/auth-request.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-request.c	Tue Jan 05 11:01:26 2016 -0500
+++ b/src/auth/auth-request.c	Tue Jan 05 11:08:01 2016 -0500
@@ -1335,12 +1335,12 @@
 		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 &&