From: xiexingguo <258156334@qq.com> Date: Wed, 9 Sep 2015 05:56:44 +0000 (+0800) Subject: msg/simple: start over after fails to bind a port in specified range X-Git-Tag: v9.1.0~91^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90f1d25cd8b09454e19d9587e734a68e6ae19e4f;p=ceph.git msg/simple: start over after fails to bind a port in specified range Fixes: #13002 Signed-off-by: xie.xiexingguo@zte.com.cn --- diff --git a/src/msg/simple/Accepter.cc b/src/msg/simple/Accepter.cc index 3333693b706d..a8aa4955a98f 100644 --- a/src/msg/simple/Accepter.cc +++ b/src/msg/simple/Accepter.cc @@ -116,6 +116,7 @@ int Accepter::bind(const entity_addr_t &bind_addr, const set& avoid_ports) << ": " << cpp_strerror(errno) << dendl; r = -errno; + listen_addr.set_port(0); //Clear port before retry, otherwise we shall fail again. continue; } ldout(msgr->cct,10) << "accepter.bind bound on random port " << listen_addr << dendl;