@@ -473,7 +473,7 @@ struct ksock_proto {
void (*pro_pack)(struct ksock_tx *);
/* message unpack */
- void (*pro_unpack)(struct ksock_msg *);
+ void (*pro_unpack)(struct ksock_msg *msg, struct lnet_hdr *hdr);
/* queue tx on the connection */
struct ksock_tx *(*pro_queue_tx_msg)(struct ksock_conn *, struct ksock_tx *);
@@ -1174,9 +1174,7 @@ struct ksock_conn_cb *
case SOCKNAL_RX_LNET_HEADER:
/* unpack message header */
- conn->ksnc_proto->pro_unpack(&conn->ksnc_msg);
-
- lnet_hdr_from_nid4(&hdr, &conn->ksnc_msg.ksm_u.lnetmsg_nid4);
+ conn->ksnc_proto->pro_unpack(&conn->ksnc_msg, &hdr);
if (conn->ksnc_peer->ksnp_id.pid & LNET_PID_USERFLAG) {
/* Userspace peer_ni */
@@ -760,18 +760,19 @@
}
static void
-ksocknal_unpack_msg_v1(struct ksock_msg *msg)
+ksocknal_unpack_msg_v1(struct ksock_msg *msg, struct lnet_hdr *hdr)
{
msg->ksm_csum = 0;
msg->ksm_type = KSOCK_MSG_LNET;
msg->ksm_zc_cookies[0] = 0;
msg->ksm_zc_cookies[1] = 0;
+ lnet_hdr_from_nid4(hdr, &msg->ksm_u.lnetmsg_nid4);
}
static void
-ksocknal_unpack_msg_v2(struct ksock_msg *msg)
+ksocknal_unpack_msg_v2(struct ksock_msg *msg, struct lnet_hdr *hdr)
{
- return; /* Do nothing */
+ lnet_hdr_from_nid4(hdr, &msg->ksm_u.lnetmsg_nid4);
}
const struct ksock_proto ksocknal_protocol_v1x = {