From: Ilya Dryomov <ilya.dryomov@inktank.com>
Date: Mon, 30 Dec 2013 19:21:29 +0200
Subject: libceph: use CEPH_MON_PORT when the specified port is 0
Git-commit: f48db1e9ac6f1578ab7efef9f66c70279e2f0cb5
Patch-mainline: v3.14-rc1
References: FATE#318328 bsc#917884

Similar to userspace, don't bail with "parse_ips bad ip ..." if the
specified port is port 0, instead use port CEPH_MON_PORT (6789, the
default monitor port).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Acked-by: Lee Duncan <lduncan@suse.com>
---
 net/ceph/messenger.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1867,7 +1867,9 @@ int ceph_parse_ips(const char *c, const
 				port = (port * 10) + (*p - '0');
 				p++;
 			}
-			if (port > 65535 || port == 0)
+			if (port == 0)
+				port = CEPH_MON_PORT;
+			else if (port > 65535)
 				goto bad;
 		} else {
 			port = CEPH_MON_PORT;
