]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MForward: reencode forwarded message if target has differing features
authorSage Weil <sage@redhat.com>
Sat, 22 Oct 2016 18:01:34 +0000 (14:01 -0400)
committerKefu Chai <kchai@redhat.com>
Wed, 2 Nov 2016 11:23:24 +0000 (19:23 +0800)
This ensures we reencode the payload with the
appropriate set of features if the client, us, or the
target do not have identical features.  Otherwise we
may forward an encoding with more features than the
target can handle.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a433455e59067a844c3df4a0d6080db2ceb4ec59)

src/messages/MForward.h

index c6804cd55cba59cfa6e63a9d9df1f2cac3f2dc98..2c00825c940f01a628b4d906dcc3cf2b09d78e4a 100644 (file)
@@ -77,6 +77,9 @@ public:
     // message are changed when reencoding with more features than the
     // client had originally.  That should never happen, but we may as
     // well be defensive here.
+    if (con_features != features) {
+      msg->clear_payload();
+    }
     encode_message(msg, features & con_features, payload);
     ::encode(con_features, payload);
     ::encode(entity_name, payload);