Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20612005c51a5ba1bb17902276b9216825958724
Commit:     20612005c51a5ba1bb17902276b9216825958724
Parent:     d5b6443014940eb83788161c69b17cb7a1ffaaed
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 6 11:57:23 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:16:05 2007 -0400

    SUNRPC: Introduce support for setting the port number in IPv6 addresses
    
    We could clone xs_set_port, but this is easier overall.
    
    Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
    Cc: Aurelien Charbon <[EMAIL PROTECTED]>
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 net/sunrpc/xprtsock.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 23e5865..a2dddec 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1211,11 +1211,20 @@ static unsigned short xs_get_random_port(void)
  */
 static void xs_set_port(struct rpc_xprt *xprt, unsigned short port)
 {
-       struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr;
+       struct sockaddr *addr = (struct sockaddr *) &xprt->addr;
 
        dprintk("RPC:       setting port for xprt %p to %u\n", xprt, port);
 
-       sap->sin_port = htons(port);
+       switch (addr->sa_family) {
+       case AF_INET:
+               ((struct sockaddr_in *)addr)->sin_port = htons(port);
+               break;
+       case AF_INET6:
+               ((struct sockaddr_in6 *)addr)->sin6_port = htons(port);
+               break;
+       default:
+               BUG();
+       }
 }
 
 static int xs_bind(struct sock_xprt *transport, struct socket *sock)
-
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