From: Joao Eduardo Luis Date: Fri, 14 Nov 2014 21:01:39 +0000 (+0000) Subject: messages: MForward: stash auth entity name X-Git-Tag: v0.89~9^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=87734747dca113d6a13d1e78da52e6009a9e935a;p=ceph.git messages: MForward: stash auth entity name This will allow us to assess the entity name, used during auth, for a forwarded request, which is otherwise unavailable to the receiving party. Fixes: #9913 (partially) Backport: giant Signed-off-by: Joao Eduardo Luis --- diff --git a/src/messages/MForward.h b/src/messages/MForward.h index 6a0e2bf71cbc4..c19865428c2b9 100644 --- a/src/messages/MForward.h +++ b/src/messages/MForward.h @@ -29,8 +29,9 @@ struct MForward : public Message { entity_inst_t client; MonCap client_caps; uint64_t con_features; + EntityName entity_name; - static const int HEAD_VERSION = 2; + static const int HEAD_VERSION = 3; static const int COMPAT_VERSION = 1; MForward() : Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION), @@ -62,6 +63,7 @@ public: ::encode(client_caps, payload, features); encode_message(msg, features, payload); ::encode(con_features, payload); + ::encode(entity_name, payload); } void decode_payload() { @@ -75,6 +77,14 @@ public: } else { con_features = 0; } + if (header.version >= 3) { + ::decode(entity_name, p); + } else { + // we are able to know the entity type, obtaining it from the + // entity_name_t on 'client', but we have no idea about the + // entity name, so we'll just use a friendly '?' instead. + entity_name.set(client.name.type(), "?"); + } }