]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: populate compat_version for encoded messages
authorSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 22:30:30 +0000 (14:30 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 10 Feb 2012 06:09:05 +0000 (22:09 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/msg/Message.cc

index 26076995c32c6f5d18c4f0294cd15adb2bf6d751..f863b8ae4ccfc6a61074040868b67f670ff86685 100644 (file)
@@ -153,6 +153,10 @@ void Message::encode(uint64_t features, bool datacrc)
   if (empty_payload()) {
     encode_payload(features);
 
+    // if the encoder didn't specify past compatibility, we assume it
+    // is incompatible.
+    if (header.compat_version == 0)
+      header.compat_version = header.version;
   }
   calc_front_crc();
   if (datacrc) {