]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: learn my address from peer
authorKefu Chai <kchai@redhat.com>
Thu, 25 Apr 2019 14:10:16 +0000 (22:10 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 16:12:57 +0000 (00:12 +0800)
OSD always relies on its server to tell its address, without this
feature, it will advertise a blank ip address to monitor in MOSDBoot.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/net/ProtocolV2.cc

index 6fdc7163e04919927d19b16bdc0e50bb1691a4e3..f57952e4fad60b20c286002903ca53826e836d5c 100644 (file)
@@ -789,6 +789,13 @@ void ProtocolV2::execute_connecting()
             dispatch_reset();
             abort_in_close();
           }
+          if (messenger.get_myaddrs().empty() ||
+              messenger.get_myaddrs().front().is_blank_ip()) {
+            logger().debug("peer {} says I am {}", conn.target_addr, _peer_addr);
+            return messenger.learned_addr(_peer_addr);
+          } else {
+            return seastar::now();
+          }
         }).then([this] {
           return client_auth();
         }).then([this] {