From bfafc3b3fd7305a39a507d11e443f93a2ae22f31 Mon Sep 17 00:00:00 2001 From: Roi Dayan Date: Thu, 4 Feb 2016 16:41:05 +0200 Subject: [PATCH] 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 --- src/msg/xio/XioPortal.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.47.3