changeset 20968:2a7e47e01509

director: Make sure IP address parsing works in DIRECTOR-ADD/REMOVE We were passing the entire string through to net_addr2ip(). It seems that inet_aton() stops at whitespace though, so this wasn't actually causing errors at least on Linux.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 24 Oct 2016 20:16:57 +0300
parents 1be6845a989b
children 193f82412af9
files src/director/doveadm-connection.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/director/doveadm-connection.c	Mon Oct 24 20:08:54 2016 +0300
+++ b/src/director/doveadm-connection.c	Mon Oct 24 20:16:57 2016 +0300
@@ -203,7 +203,7 @@
 
 	args = t_strsplit_tab(line);
 	if (args[0] == NULL ||
-	    net_addr2ip(line, &ip) < 0 ||
+	    net_addr2ip(args[0], &ip) < 0 ||
 	    (args[1] != NULL && net_str2port(args[1], &port) < 0)) {
 		i_error("doveadm sent invalid DIRECTOR-ADD parameters");
 		return -1;
@@ -227,7 +227,7 @@
 
 	args = t_strsplit_tab(line);
 	if (args[0] == NULL ||
-	    net_addr2ip(line, &ip) < 0 ||
+	    net_addr2ip(args[0], &ip) < 0 ||
 	    (args[1] != NULL && net_str2port(args[1], &port) < 0)) {
 		i_error("doveadm sent invalid DIRECTOR-REMOVE parameters");
 		return -1;