]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/msg_types: encode entity_addr_t TYPE_ANY as TYPE_LEGACY for pre-nautilus
authorSage Weil <sage@redhat.com>
Wed, 2 Jan 2019 23:07:45 +0000 (17:07 -0600)
committerSage Weil <sage@redhat.com>
Thu, 3 Jan 2019 17:17:38 +0000 (11:17 -0600)
This is primarily for OSDMap's blacklist, which, starting with nautilus,
is populated by ANY addrs instead of LEGACY addrs.

Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/msg_types.h

index 422ee5c01aedc7e934092bd39cbe704674100dd9..67d41d58e2b24d6aaeb9141edb3b16467bb99a2e 100644 (file)
@@ -453,7 +453,18 @@ struct entity_addr_t {
     }
     encode((__u8)1, bl);
     ENCODE_START(1, 1, bl);
-    encode(type, bl);
+    if (HAVE_FEATURE(features, SERVER_NAUTILUS)) {
+      encode(type, bl);
+    } else {
+      // map any -> legacy for old clients.  this is primary for the benefit
+      // of OSDMap's blacklist, but is reasonable in general since any: is
+      // meaningless for pre-nautilus clients or daemons.
+      auto t = type;
+      if (t == TYPE_ANY) {
+       t = TYPE_LEGACY;
+      }
+      encode(t, bl);
+    }
     encode(nonce, bl);
     __u32 elen = get_sockaddr_len();
     encode(elen, bl);