Skip to content

Commit

Permalink
messages/MForward: reencode forwarded message if target has differing…
Browse files Browse the repository at this point in the history
… features

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 <[email protected]>
  • Loading branch information
liewegas committed Oct 24, 2016
1 parent 3eec78e commit a433455
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/messages/MForward.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ struct MForward : public Message {
// 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);
Expand Down

0 comments on commit a433455

Please sign in to comment.