]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/simple: start over after fails to bind a port in specified range 5846/head
authorxiexingguo <258156334@qq.com>
Wed, 9 Sep 2015 05:56:44 +0000 (13:56 +0800)
committerxiexingguo <258156334@qq.com>
Thu, 10 Sep 2015 10:52:50 +0000 (18:52 +0800)
Fixes: #13002
Signed-off-by: xie.xiexingguo@zte.com.cn
src/msg/simple/Accepter.cc

index 3333693b706dc261fd8200c1bd43c66fda2a47f0..a8aa4955a98ffc661c845c962acdd20786b311fe 100644 (file)
@@ -116,6 +116,7 @@ int Accepter::bind(const entity_addr_t &bind_addr, const set<int>& 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;