[PATCH 10/14] SQUASHME: nfs41: sunrpc: Don't skip past the RPC call direction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[squash with: nfs41: Skippast the RPC call direction]

xs_tcp_read_data() has been modified to include the RPC call direction in the
XDR buffer.  We need to read the direction during the header verification.

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@xxxxxxxxxx>
---
 net/sunrpc/clnt.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index e7fffd2..d5a85a9 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1507,12 +1507,12 @@ rpc_verify_header(struct rpc_task *task)
 	if ((len -= 3) < 0)
 		goto out_overflow;
 
-	/*
-	 * Skip the XID and call direction.
-	 * The underlying transport has read the XID and RPC call direction
-	 * to determine this is an RPC reply.
-	 */
-	p += 2;
+	p += 1; /* skip XID */
+	if ((n = ntohl(*p++)) != RPC_REPLY) {
+		dprintk("RPC: %5u %s: not an RPC reply: %x\n",
+			task->tk_pid, __func__, n);
+		goto out_garbage;
+	}
 
 	if ((n = ntohl(*p++)) != RPC_MSG_ACCEPTED) {
 		if (--len < 0)
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux