]> 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)
committerSage Weil <sage@redhat.com>
Mon, 24 Oct 2016 16:10:17 +0000 (11:10 -0500)
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>
src/messages/MForward.h

index 514c4a359557abb8a675b79d6890b72d67bf751f..8eb0b17850c4edcb48e2d9a17fd07dd50eaaa72c 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);