- if (req->rq_reqdata_len < sizeof(struct lustre_msg)) {
- CERROR("request size %d too small\n", req->rq_reqdata_len);
- RETURN(SECSVC_DROP);
- }
-
- /*
- * only expect v2 message.
- */
- switch (msg->lm_magic) {
- case LUSTRE_MSG_MAGIC_V2:
- req->rq_flvr.sf_rpc = WIRE_FLVR(msg->lm_secflvr);
- break;
- case LUSTRE_MSG_MAGIC_V2_SWABBED:
- req->rq_flvr.sf_rpc = WIRE_FLVR(__swab32(msg->lm_secflvr));
+ rc = __lustre_unpack_msg(msg, req->rq_reqdata_len);
+ switch (rc) {
+ case 1:
+ lustre_set_req_swabbed(req, MSG_PTLRPC_HEADER_OFF);
+ case 0: