Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2442222283918c2d1c20ae651d95fe168757938b
Commit:     2442222283918c2d1c20ae651d95fe168757938b
Parent:     ad06e4bd62351bc569cca0f25d68c58dbd298146
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 00:53:33 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 12 09:48:35 2007 -0800

    [PATCH] knfsd: SUNRPC: Use sockaddr_storage to store address in 
svc_deferred_req
    
    Sockaddr_storage will allow us to store arbitrary socket addresses in the
    svc_deferred_req struct.
    
    Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
    Cc: Aurelien Charbon <[EMAIL PROTECTED]>
    Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/sunrpc/svc.h |    5 +++--
 net/sunrpc/svcsock.c       |    6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 1178689..52db9c8 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -292,8 +292,9 @@ static inline void svc_free_res_pages(struct svc_rqst 
*rqstp)
 
 struct svc_deferred_req {
        u32                     prot;   /* protocol (UDP or TCP) */
-       struct sockaddr_in      addr;
-       struct svc_sock         *svsk;  /* where reply must go */
+       struct svc_sock         *svsk;
+       struct sockaddr_storage addr;   /* where reply must go */
+       size_t                  addrlen;
        __be32                  daddr;  /* where reply must come from */
        struct cache_deferred_req handle;
        int                     argslen;
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 08de328..6680e0f 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1785,7 +1785,8 @@ svc_defer(struct cache_req *req)
 
                dr->handle.owner = rqstp->rq_server;
                dr->prot = rqstp->rq_prot;
-               dr->addr = rqstp->rq_addr;
+               memcpy(&dr->addr, &rqstp->rq_addr, rqstp->rq_addrlen);
+               dr->addrlen = rqstp->rq_addrlen;
                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);
@@ -1809,7 +1810,8 @@ static int svc_deferred_recv(struct svc_rqst *rqstp)
        rqstp->rq_arg.page_len = 0;
        rqstp->rq_arg.len = dr->argslen<<2;
        rqstp->rq_prot        = dr->prot;
-       rqstp->rq_addr        = dr->addr;
+       memcpy(&rqstp->rq_addr, &dr->addr, dr->addrlen);
+       rqstp->rq_addrlen     = dr->addrlen;
        rqstp->rq_daddr       = dr->daddr;
        rqstp->rq_respages    = rqstp->rq_pages;
        return dr->argslen<<2;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to