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

    [PATCH] knfsd: SUNRPC: Make rq_daddr field address-version independent
    
    The rq_daddr field must support larger addresses.
    
    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 |   15 +++++++++++----
 net/sunrpc/svcsock.c       |    4 ++--
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 96c1b6a..6d6892f 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -11,6 +11,7 @@
 #define SUNRPC_SVC_H
 
 #include <linux/in.h>
+#include <linux/in6.h>
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/xdr.h>
 #include <linux/sunrpc/auth.h>
@@ -191,7 +192,13 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
        iov->iov_len += sizeof(__be32);
 }
 
-       
+union svc_addr_u {
+    struct in_addr     addr;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+    struct in6_addr    addr6;
+#endif
+};
+
 /*
  * The context of a single thread, including the request currently being
  * processed.
@@ -227,8 +234,8 @@ struct svc_rqst {
        unsigned short
                                rq_secure  : 1; /* secure port */
 
-
-       __be32                  rq_daddr;       /* dest addr of request - reply 
from here */
+       union svc_addr_u        rq_daddr;       /* dest addr of request
+                                                *  - reply from here */
 
        void *                  rq_argp;        /* decoded arguments */
        void *                  rq_resp;        /* xdr'd results */
@@ -308,7 +315,7 @@ struct svc_deferred_req {
        struct svc_sock         *svsk;
        struct sockaddr_storage addr;   /* where reply must go */
        size_t                  addrlen;
-       __be32                  daddr;  /* where reply must come from */
+       union svc_addr_u        daddr;  /* where reply must come from */
        struct cache_deferred_req handle;
        int                     argslen;
        __be32                  args[0];
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index b116696..9d7a819 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -484,7 +484,7 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
                cmh->cmsg_level = SOL_IP;
                cmh->cmsg_type = IP_PKTINFO;
                pki->ipi_ifindex = 0;
-               pki->ipi_spec_dst.s_addr = rqstp->rq_daddr;
+               pki->ipi_spec_dst.s_addr = rqstp->rq_daddr.addr.s_addr;
 
                if (sock_sendmsg(sock, &msg, 0) < 0)
                        goto out;
@@ -763,7 +763,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
        rqstp->rq_addrlen = sizeof(struct sockaddr_in);
 
        /* Remember which interface received this request */
-       rqstp->rq_daddr = skb->nh.iph->daddr;
+       rqstp->rq_daddr.addr.s_addr = skb->nh.iph->daddr;
 
        if (skb_is_nonlinear(skb)) {
                /* we have to copy */
-
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