From 21297a65a50fa2b81efa8f8fe3169f928eaf7011 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 14 Mar 2017 09:56:56 -0400 Subject: [PATCH] mgr/Session: keep inst, not addr For parity with log messages from other daemons etc. Signed-off-by: Sage Weil --- src/mgr/DaemonServer.cc | 4 +++- src/mgr/MgrSession.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index b6e2bc6079b5b..429db5faa5359 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -128,7 +128,7 @@ bool DaemonServer::ms_verify_authorizer(Connection *con, } MgrSessionRef s(new MgrSession); - s->addr = con->get_peer_addr(); + s->inst.addr = con->get_peer_addr(); AuthCapsInfo caps_info; is_valid = handler->verify_authorizer( @@ -383,6 +383,8 @@ bool DaemonServer::handle_command(MCommand *m) return true; } session->put(); // SessionRef takes a ref + if (session->inst.name == entity_name_t()) + session->inst.name = m->get_source(); string format; boost::scoped_ptr f; diff --git a/src/mgr/MgrSession.h b/src/mgr/MgrSession.h index 39b3dff7023c8..328871d2ef962 100644 --- a/src/mgr/MgrSession.h +++ b/src/mgr/MgrSession.h @@ -16,7 +16,7 @@ struct MgrSession : public RefCountedObject { uint64_t global_id = 0; EntityName entity_name; - entity_addr_t addr; + entity_inst_t inst; // mon caps are suitably generic for mgr MonCap caps; -- 2.39.5