- cr.acr_magic = LNET_PROTO_ACCEPTOR_MAGIC;
- cr.acr_version = LNET_PROTO_ACCEPTOR_VERSION;
- cr.acr_nid = peer_nid;
-
- if (the_lnet.ln_testprotocompat) {
- /* single-shot proto check */
- if (test_and_clear_bit(2, &the_lnet.ln_testprotocompat))
- cr.acr_version++;
- if (test_and_clear_bit(3, &the_lnet.ln_testprotocompat))
- cr.acr_magic = LNET_PROTO_MAGIC;
+ if (nid_is_nid4(peer_nid)) {
+ cr1.acr_magic = LNET_PROTO_ACCEPTOR_MAGIC;
+ cr1.acr_version = LNET_PROTO_ACCEPTOR_VERSION;
+ cr1.acr_nid = lnet_nid_to_nid4(peer_nid);
+ cr = &cr1;
+ crsize = sizeof(cr1);
+
+ if (the_lnet.ln_testprotocompat) {
+ /* single-shot proto check */
+ if (test_and_clear_bit(
+ 2, &the_lnet.ln_testprotocompat))
+ cr1.acr_version++;
+ if (test_and_clear_bit(
+ 3, &the_lnet.ln_testprotocompat))
+ cr1.acr_magic = LNET_PROTO_MAGIC;
+ }
+
+ } else {
+ cr2.acr_magic = LNET_PROTO_ACCEPTOR_MAGIC;
+ cr2.acr_version = LNET_PROTO_ACCEPTOR_VERSION_16;
+ cr2.acr_nid = *peer_nid;
+ cr = &cr2;
+ crsize = sizeof(cr2);