#define DEFINE_MSGR2_FEATURE(bit, incarnation, name) \
const static uint64_t CEPH_MSGR2_FEATURE_##name = (1ULL << bit); \
const static uint64_t CEPH_MSGR2_FEATUREMASK_##name = \
- (1ULL << bit | CEPH_FEATURE_INCARNATION_##incarnation);
+ (1ULL << bit | CEPH_MSGR2_INCARNATION_##incarnation);
#define HAVE_MSGR2_FEATURE(x, name) \
(((x) & (CEPH_MSGR2_FEATUREMASK_##name)) == (CEPH_MSGR2_FEATUREMASK_##name))
+DEFINE_MSGR2_FEATURE( 0, 1, REVISION_1) // msgr2.1
-#define CEPH_MSGR2_SUPPORTED_FEATURES (0ull)
+#define CEPH_MSGR2_SUPPORTED_FEATURES (CEPH_MSGR2_FEATURE_REVISION_1)
-#define CEPH_MSGR2_REQUIRED_FEATURES (CEPH_MSGR2_SUPPORTED_FEATURES)
+#define CEPH_MSGR2_REQUIRED_FEATURES (0ull)
/*
<< " :" << connection->port
<< " s=" << get_state_name(state) << " pgs=" << peer_global_seq
<< " cs=" << connect_seq << " l=" << connection->policy.lossy
+ << " rev1=" << HAVE_MSGR2_FEATURE(peer_supported_features,
+ REVISION_1)
<< " rx=" << session_stream_handlers.rx.get()
<< " tx=" << session_stream_handlers.tx.get()
<< ").";
this->connection_features = msgr2_required;
}
+ // if the peer supports msgr2.1, switch to it
+ bool is_rev1 = HAVE_MSGR2_FEATURE(peer_supported_features, REVISION_1);
+ tx_frame_asm.set_is_rev1(is_rev1);
+ rx_frame_asm.set_is_rev1(is_rev1);
+
if (state == BANNER_CONNECTING) {
state = HELLO_CONNECTING;
}
return _fault();
}
auth_meta->con_mode = auth_done.con_mode();
+ bool is_rev1 = HAVE_MSGR2_FEATURE(peer_supported_features, REVISION_1);
session_stream_handlers = ceph::crypto::onwire::rxtx_t::create_handler_pair(
- cct, *auth_meta, /*new_nonce_format=*/false, /*crossed=*/false);
+ cct, *auth_meta, /*new_nonce_format=*/is_rev1, /*crossed=*/false);
state = AUTH_CONNECTING_SIGN;
ceph_assert(auth_meta);
// TODO: having a possibility to check whether we're server or client could
// allow reusing finish_auth().
+ bool is_rev1 = HAVE_MSGR2_FEATURE(peer_supported_features, REVISION_1);
session_stream_handlers = ceph::crypto::onwire::rxtx_t::create_handler_pair(
- cct, *auth_meta, /*new_nonce_format=*/false, /*crossed=*/true);
+ cct, *auth_meta, /*new_nonce_format=*/is_rev1, /*crossed=*/true);
const auto sig = auth_meta->session_key.empty() ? sha256_digest_t() :
auth_meta->session_key.hmac_sha256(cct, pre_auth.rxbuf);