Whamcloud - gitweb
branch: HEAD
[fs/lustre-release.git] / lustre / ptlrpc / sec_plain.c
index 5c75f66..53e5fe7 100644 (file)
@@ -130,7 +130,6 @@ static
 int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 {
         struct lustre_msg *msg = req->rq_repbuf;
-        __u16              wflvr;
         ENTRY;
 
         if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) {
@@ -138,16 +137,15 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
                 RETURN(-EPROTO);
         }
 
-        wflvr = WIRE_FLVR_RPC(msg->lm_secflvr);
-
         /* expect no user desc in reply */
-        if (PLAIN_WFLVR_HAS_USER(wflvr)) {
+        if (PLAIN_WFLVR_HAS_USER(msg->lm_secflvr)) {
                 CERROR("Unexpected udesc flag in reply\n");
                 RETURN(-EPROTO);
         }
 
         /* whether we sent with bulk or not, we expect the same in reply */
-        if (!equi(req->rq_pack_bulk == 1, PLAIN_WFLVR_HAS_BULK(wflvr))) {
+        if (!equi(req->rq_pack_bulk == 1,
+                  PLAIN_WFLVR_HAS_BULK(msg->lm_secflvr))) {
                 CERROR("%s bulk checksum in reply\n",
                        req->rq_pack_bulk ? "Missing" : "Unexpected");
                 RETURN(-EPROTO);
@@ -173,7 +171,7 @@ int plain_cli_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
         LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
 
         return bulk_csum_cli_request(desc, req->rq_bulk_read,
-                                     req->rq_flvr.sf_bulk_csum,
+                                     req->rq_flvr.sf_bulk_hash,
                                      req->rq_reqbuf,
                                      PLAIN_PACK_BULK_OFF);
 }
@@ -272,9 +270,9 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp,
 
         LASSERT(RPC_FLVR_POLICY(sf->sf_rpc) == SPTLRPC_POLICY_PLAIN);
 
-        if (sf->sf_bulk_priv != BULK_PRIV_ALG_NULL) {
-                CERROR("plain policy don't support bulk encryption: %u\n",
-                       sf->sf_bulk_priv);
+        if (sf->sf_bulk_ciph != BULK_CIPH_ALG_NULL) {
+                CERROR("plain policy don't support bulk cipher: %u\n",
+                       sf->sf_bulk_ciph);
                 RETURN(NULL);
         }
 
@@ -389,7 +387,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
                 LASSERT(req->rq_bulk_read || req->rq_bulk_write);
 
                 buflens[PLAIN_PACK_BULK_OFF] = bulk_sec_desc_size(
-                                                req->rq_flvr.sf_bulk_csum, 1,
+                                                req->rq_flvr.sf_bulk_hash, 1,
                                                 req->rq_bulk_read);
         }
 
@@ -449,7 +447,7 @@ int plain_alloc_repbuf(struct ptlrpc_sec *sec,
                 LASSERT(req->rq_bulk_read || req->rq_bulk_write);
 
                 buflens[PLAIN_PACK_BULK_OFF] = bulk_sec_desc_size(
-                                                req->rq_flvr.sf_bulk_csum, 0,
+                                                req->rq_flvr.sf_bulk_hash, 0,
                                                 req->rq_bulk_read);
         }
 
@@ -609,7 +607,7 @@ int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
                 LASSERT(bsd);
 
                 buflens[PLAIN_PACK_BULK_OFF] = bulk_sec_desc_size(
-                                                        bsd->bsd_csum_alg, 0,
+                                                        bsd->bsd_hash_alg, 0,
                                                         req->rq_bulk_read);
         }
         rs_size += lustre_msg_size_v2(PLAIN_PACK_SEGMENTS, buflens);