]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: hide peer_global_id from Connection class 48484/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 13 Oct 2022 09:51:52 +0000 (17:51 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 13 Oct 2022 09:51:52 +0000 (17:51 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/auth/AuthServer.h
src/crimson/auth/DummyAuth.h
src/crimson/mon/MonClient.cc
src/crimson/mon/MonClient.h
src/crimson/net/Connection.h
src/crimson/net/ProtocolV2.cc
src/crimson/net/SocketConnection.h

index 800e2cd6ceb71782a0bd3231d4eaea746293f318..a808410d2d5b75357f4fcc7628f57ccec9d70df3 100644 (file)
@@ -35,6 +35,7 @@ public:
     bool more,           //< true if this is not the first part of the handshake
     uint32_t auth_method,
     const bufferlist& bl,
+    uint64_t *p_peer_global_id,
     bufferlist *reply) = 0;
 };
 
index 89bb6734f61e3d2801162024967e97249b6a99d4..7a3dd7ec4d6a4b9801366b0e4d6e8c05ff3b4f11 100644 (file)
@@ -70,6 +70,7 @@ public:
     bool more,
     uint32_t auth_method,
     const bufferlist& bl,
+    uint64_t *p_peer_global_id,
     bufferlist *reply) override {
     return 1;
   }
index d89c0aded96d4c3e4454efc42390afe3fcebf7ac..24a9e2fc53299a2fcc28023e8db0a6a7a6d33d26 100644 (file)
@@ -589,6 +589,7 @@ int Client::handle_auth_request(crimson::net::Connection &conn,
                                 bool more,
                                 uint32_t auth_method,
                                 const ceph::bufferlist& payload,
+                                uint64_t *p_peer_global_id,
                                 ceph::bufferlist *reply)
 {
   if (payload.length() == 0) {
@@ -626,7 +627,7 @@ int Client::handle_auth_request(crimson::net::Connection &conn,
     auth_meta.get_connection_secret_length(),
     reply,
     &name,
-    &conn.peer_global_id,
+    p_peer_global_id,
     &caps_info,
     &auth_meta.session_key,
     &auth_meta.connection_secret,
index c27291355a383297baac39d0e4ab1f88dd57f308..4e6d1e2dc3920bf96db9fc5d17dbb21499690335 100644 (file)
@@ -131,6 +131,7 @@ private:
                          bool more,
                          uint32_t auth_method,
                          const ceph::bufferlist& payload,
+                         uint64_t *p_peer_global_id,
                          ceph::bufferlist *reply) final;
 
   crimson::common::CephContext cct; // for auth_registry
index 0f6bbb7ae8fbe269ef816824abea0cb7586e7ed1..084d0a70645b03220429885d5a6bc4e34eb44948 100644 (file)
@@ -79,9 +79,6 @@ class Connection : public seastar::enable_shared_from_this<Connection> {
     set_peer_id(name.num());
   }
 
- public:
-  uint64_t peer_global_id = 0;
-
  protected:
   uint64_t features = 0;
 
index 1f5f13cd1d9e508390ebf177e2be70eba40268e9..9605eaadabed6ca32bc186d2c834d91592b6e4b4 100644 (file)
@@ -966,6 +966,7 @@ seastar::future<> ProtocolV2::_handle_auth_request(bufferlist& auth_payload, boo
       more,
       auth_meta->auth_method,
       auth_payload,
+      &conn.peer_global_id,
       &reply);
   switch (r) {
    // successful
index 814e75d935d6cccaf5c1d992765b4bc255a0f0be..a33c525ed5f1bf8a616761b724e67a4952da57c4 100644 (file)
@@ -49,6 +49,8 @@ class SocketConnection : public Connection {
   // messages sent, but not yet acked by peer
   std::deque<MessageURef> sent;
 
+  uint64_t peer_global_id = 0;
+
   seastar::shard_id shard_id() const;
 
  public: