From: Haomai Wang Date: Tue, 23 May 2017 16:41:49 +0000 (+0800) Subject: msg: don't set msgr addr when disabing client bind X-Git-Tag: v12.1.0~253^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2571dc4cf4dd43568b251323095db2058f1cc2c;p=ceph.git msg: don't set msgr addr when disabing client bind if disabling client bind, client side will send handshake message with blank ip. so the server side will ignore this. otherwise, server side decide to learn this addr which isn't the expected addr Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncMessenger.cc b/src/msg/async/AsyncMessenger.cc index 122473179c3c..4695844055f1 100644 --- a/src/msg/async/AsyncMessenger.cc +++ b/src/msg/async/AsyncMessenger.cc @@ -412,6 +412,8 @@ int AsyncMessenger::rebind(const set& avoid_ports) int AsyncMessenger::client_bind(const entity_addr_t &bind_addr) { + if (!cct->_conf->ms_bind_before_connect) + return 0; Mutex::Locker l(lock); if (did_bind) { assert(my_inst.addr == bind_addr); diff --git a/src/msg/simple/SimpleMessenger.cc b/src/msg/simple/SimpleMessenger.cc index 600f26c3f1c2..d451df9c6207 100644 --- a/src/msg/simple/SimpleMessenger.cc +++ b/src/msg/simple/SimpleMessenger.cc @@ -309,6 +309,8 @@ int SimpleMessenger::rebind(const set& avoid_ports) int SimpleMessenger::client_bind(const entity_addr_t &bind_addr) { + if (!cct->_conf->ms_bind_before_connect) + return 0; Mutex::Locker l(lock); if (did_bind) { assert(my_inst.addr == bind_addr);