]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] svcrpc: save and restore the daddr field when request deferred
authorJ. Bruce Fields <bfields@citi.umich.edu>
Thu, 19 Jan 2006 01:43:16 +0000 (17:43 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 19 Jan 2006 03:20:24 +0000 (19:20 -0800)
The server code currently keeps track of the destination address on every
request so that it can reply using the same address.  However we forget to do
that in the case of a deferred request.  Remedy this oversight.  >From folks
at PolyServe.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/sunrpc/svc.h
net/sunrpc/svcsock.c

index e4086ec8b952a3a87b5f16bd654df3c70a05066a..50cab2a09f28caebad19282c2b8a6b610ef13175 100644 (file)
@@ -246,6 +246,7 @@ struct svc_deferred_req {
        u32                     prot;   /* protocol (UDP or TCP) */
        struct sockaddr_in      addr;
        struct svc_sock         *svsk;  /* where reply must go */
+       u32                     daddr;  /* where reply must come from */
        struct cache_deferred_req handle;
        int                     argslen;
        u32                     args[0];
index e67613e4eb18c7d39d0d4fe1c3cf28c6cffb12b0..50580620e89704038f1957fb6b95e2cf8e2dbd12 100644 (file)
@@ -1527,6 +1527,7 @@ svc_defer(struct cache_req *req)
                dr->handle.owner = rqstp->rq_server;
                dr->prot = rqstp->rq_prot;
                dr->addr = rqstp->rq_addr;
+               dr->daddr = rqstp->rq_daddr;
                dr->argslen = rqstp->rq_arg.len >> 2;
                memcpy(dr->args, rqstp->rq_arg.head[0].iov_base-skip, dr->argslen<<2);
        }
@@ -1552,6 +1553,7 @@ static int svc_deferred_recv(struct svc_rqst *rqstp)
        rqstp->rq_arg.len = dr->argslen<<2;
        rqstp->rq_prot        = dr->prot;
        rqstp->rq_addr        = dr->addr;
+       rqstp->rq_daddr       = dr->daddr;
        return dr->argslen<<2;
 }