]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] kNFSd: Fix problem with buffer length with rpc/tcp
authorNeil Brown <neilb@cse.unsw.edu.au>
Wed, 30 Oct 2002 08:24:33 +0000 (00:24 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 30 Oct 2002 08:24:33 +0000 (00:24 -0800)
I forgot to add '1' for the record-length header in RPC/TCP.
 Thanks to  Hirokazu Takahashi <taka@valinux.co.jp>

net/sunrpc/svcsock.c

index 7cb19d693f6443b0afc42e5291b549ee20fd95f1..6c2b97c5d18deecf70389dcc4a33e226ec4eca2a 100644 (file)
@@ -882,9 +882,9 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
 
        dprintk("svc: TCP complete record (%d bytes)\n", len);
 
-       /* Position reply write pointer immediately args,
+       /* Position reply write pointer immediately after args,
         * allowing for record length */
-       rqstp->rq_resbuf.base = rqstp->rq_argbuf.base + (len>>2);
+       rqstp->rq_resbuf.base = rqstp->rq_argbuf.base + 1 + (len>>2);
        rqstp->rq_resbuf.buf  = rqstp->rq_resbuf.base + 1;
        rqstp->rq_resbuf.len  = 1;
        rqstp->rq_resbuf.buflen= rqstp->rq_argbuf.buflen - (len>>2) - 1;
@@ -892,7 +892,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
        rqstp->rq_skbuff      = 0;
        rqstp->rq_argbuf.buf += 1;
        rqstp->rq_argbuf.len  = (len >> 2);
-       rqstp->rq_argbuf.buflen = (len >> 2);
+       rqstp->rq_argbuf.buflen = (len >> 2) +1;
        rqstp->rq_prot        = IPPROTO_TCP;
 
        /* Reset TCP read info */