From: Roi Dayan Date: Thu, 4 Feb 2016 14:41:05 +0000 (+0200) Subject: xio: avoid trying bind to port we know will fail X-Git-Tag: v10.1.0~370^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bfafc3b3fd7305a39a507d11e443f93a2ae22f31;p=ceph.git xio: avoid trying bind to port we know will fail When going over range from port_min to port_max to find open port to bind we can increase port_min after successful bind so the next portal will start looking from the next port. Signed-off-by: Roi Dayan --- diff --git a/src/msg/xio/XioPortal.cc b/src/msg/xio/XioPortal.cc index 6c0065902d2f..c158764d3aad 100644 --- a/src/msg/xio/XioPortal.cc +++ b/src/msg/xio/XioPortal.cc @@ -76,8 +76,10 @@ int XioPortals::bind(struct xio_session_ops *ops, const string& base_uri, // try ports within the configured range for (; port_min <= port_max; port_min++) { r = portals[i]->bind(ops, base_uri, port_min, &result_port); - if (r == 0) + if (r == 0) { + port_min++; break; + } } if (r != 0) { lderr(msgr->cct) << "portal.bind unable to bind to " << base_uri