]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
xio: avoid trying bind to port we know will fail 7603/head
authorRoi Dayan <roid@mellanox.com>
Thu, 4 Feb 2016 14:41:05 +0000 (16:41 +0200)
committerRoi Dayan <roid@mellanox.com>
Thu, 11 Feb 2016 06:54:33 +0000 (08:54 +0200)
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 <roid@mellanox.com>
src/msg/xio/XioPortal.cc

index 6c0065902d2f8ca68789db4b3ff6462c96ba4ba9..c158764d3aad38c26ee2177e797d0dda61330770 100644 (file)
@@ -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