aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2013-12-30 12:21:29 -0500
committerIlya Dryomov <ilya.dryomov@inktank.com>2013-12-31 13:32:30 -0500
commitf48db1e9ac6f1578ab7efef9f66c70279e2f0cb5 (patch)
tree3c6a017262e228c2346cc1233326ad58868a07a5
parentcdff49918c8286ac18593e742ead25242c76c81d (diff)
libceph: use CEPH_MON_PORT when the specified port is 0
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>
-rw-r--r--net/ceph/messenger.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index bd172e1ee0ae..d2cadb5b2b63 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1866,7 +1866,9 @@ int ceph_parse_ips(const char *c, const char *end,
1866 port = (port * 10) + (*p - '0'); 1866 port = (port * 10) + (*p - '0');
1867 p++; 1867 p++;
1868 } 1868 }
1869 if (port > 65535 || port == 0) 1869 if (port == 0)
1870 port = CEPH_MON_PORT;
1871 else if (port > 65535)
1870 goto bad; 1872 goto bad;
1871 } else { 1873 } else {
1872 port = CEPH_MON_PORT; 1874 port = CEPH_MON_PORT;