Cleanup in the code.

Signed-off-by: Gilles Quillard <gilles.quillard@bull.net>
---

diff -Nru linux-2.6.9-cel5-gq-07/fs/lockd/mon.c linux-2.6.9-cel5-gq-08/fs/lockd/mon.c
--- linux-2.6.9-cel5-gq-07/fs/lockd/mon.c	2005-03-04 09:39:28.809827952 +0100
+++ linux-2.6.9-cel5-gq-08/fs/lockd/mon.c	2005-03-04 09:49:42.810485664 +0100
@@ -9,6 +9,7 @@
 #include <linux/types.h>
 #include <linux/utsname.h>
 #include <linux/kernel.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/lockd/lockd.h>
@@ -104,10 +105,7 @@
 static struct rpc_clnt *
 nsm_create(void)
 {
-	struct sockaddr_in6	sin = {
-		.sin6_family	= AF_INET6,
-		.sin6_port	= 0
-	};
+	struct sockaddr_in6	sin;
 	struct rpc_create_args args = {
 		.protocol	= IPPROTO_UDP,
 		.address	= (struct sockaddr *)&sin,
@@ -120,11 +118,7 @@
 					RPC_CLNT_ONESHOT | RPC_CLNT_RESVPORT,
 	};
 
-	sin.sin6_addr.s6_addr32[0] = 0;
-	sin.sin6_addr.s6_addr32[1] = 0;
-	sin.sin6_addr.s6_addr32[2] = htonl(0xffff);
-	sin.sin6_addr.s6_addr32[3] = htonl(INADDR_LOOPBACK);
-
+	init_sockaddr_loopback6(0, &sin);
 	return rpc_create(&args);
 }
 
diff -Nru linux-2.6.9-cel5-gq-07/fs/lockd/svc4proc.c linux-2.6.9-cel5-gq-08/fs/lockd/svc4proc.c
--- linux-2.6.9-cel5-gq-07/fs/lockd/svc4proc.c	2005-03-04 09:38:39.726289784 +0100
+++ linux-2.6.9-cel5-gq-08/fs/lockd/svc4proc.c	2005-03-04 09:49:36.135500416 +0100
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 #include <linux/time.h>
 #include <linux/slab.h>
-#include <linux/in.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/nfsd/nfsd.h>
@@ -423,10 +423,7 @@
 	struct nlm_host		*host;
 
 	dprintk("lockd: SM_NOTIFY     called\n");
-	if (saddr.sin6_addr.s6_addr32[0] != 0
-	 || saddr.sin6_addr.s6_addr32[1] != 0
-	 || saddr.sin6_addr.s6_addr32[2] != 0
-	 || saddr.sin6_addr.s6_addr32[3] != htonl(1)
+	if (! IS_ADDR6_LOOPBACK(&saddr.sin6_addr) 
 	 || ntohs(saddr.sin6_port) >= 1024) {
 		printk(KERN_WARNING
 			"lockd: rejected NSM callback from %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%d\n",
diff -Nru linux-2.6.9-cel5-gq-07/fs/lockd/svcproc.c linux-2.6.9-cel5-gq-08/fs/lockd/svcproc.c
--- linux-2.6.9-cel5-gq-07/fs/lockd/svcproc.c	2005-03-04 09:38:39.729289328 +0100
+++ linux-2.6.9-cel5-gq-08/fs/lockd/svcproc.c	2005-03-04 09:49:39.451996232 +0100
@@ -11,7 +11,7 @@
 #include <linux/types.h>
 #include <linux/time.h>
 #include <linux/slab.h>
-#include <linux/in.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/nfsd/nfsd.h>
@@ -22,12 +22,6 @@
 
 #define NLMDBG_FACILITY		NLMDBG_CLIENT
 
-#define IS_ADDR6_LOOPBACK(a) \
-    (((uint32_t *) (a))[0] == 0                       \
-     && ((uint32_t *) (a))[1] == 0                    \
-     && ((uint32_t *) (a))[2] == 0                    \
-     && ((uint32_t *) (a))[3] == htonl(1))
-
 static u32	nlmsvc_callback(struct svc_rqst *, u32, struct nlm_res *);
 static void	nlmsvc_callback_exit(struct rpc_task *);
 
@@ -456,7 +450,7 @@
 	struct nlm_host		*host;
 
 	dprintk("lockd: SM_NOTIFY     called\n");
-	if (! IS_ADDR6_LOOPBACK(&saddr.sin6_addr)
+	if (! IS_ADDR6_LOOPBACK(&saddr.sin6_addr) 
 	 || ntohs(saddr.sin6_port) >= 1024) {
 		printk(KERN_WARNING
 			"lockd: rejected NSM callback from %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%d\n",
diff -Nru linux-2.6.9-cel5-gq-07/fs/nfs/inode.c linux-2.6.9-cel5-gq-08/fs/nfs/inode.c
--- linux-2.6.9-cel5-gq-07/fs/nfs/inode.c	2005-03-04 09:38:58.528431424 +0100
+++ linux-2.6.9-cel5-gq-08/fs/nfs/inode.c	2005-03-04 09:49:25.649094592 +0100
@@ -26,6 +26,7 @@
 #include <linux/unistd.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/stats.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/nfs_fs.h>
 #include <linux/nfs_iostat.h>
 #include <linux/nfs_mount.h>
@@ -45,13 +46,6 @@
 #define NFSDBG_FACILITY		NFSDBG_VFS
 #define NFS_PARANOIA 1
 
-#define IS_ADDR6_ANY(a) \
-	(((uint32_t *) (a))[0] == 0                       \
-	 && ((uint32_t *) (a))[1] == 0                    \
-	 && (((uint32_t *) (a))[2] == 0                   \
-	     || ((uint32_t *) (a))[2] == htonl(0xffff))   \
-	 && ((uint32_t *) (a))[3] == 0)
-
 /* Maximum number of readahead requests
  * FIXME: this should really be a sysctl so that users may tune it to suit
  *        their needs. People that do NFS over a slow network, might for
@@ -1461,12 +1455,7 @@
 			kfree(server);
 			return ERR_PTR(-EINVAL);
 		}
-		server->addr.sin6_family = AF_INET6;
-		server->addr.sin6_port = data->addr.sin_port;
-		server->addr.sin6_addr.s6_addr32[0] = 0;
-		server->addr.sin6_addr.s6_addr32[1] = 0;
-		server->addr.sin6_addr.s6_addr32[2] = htonl(0xffff);
-		server->addr.sin6_addr.s6_addr32[3] = data->addr.sin_addr.s_addr;
+		map_sockaddr_4to6(&data->addr, &server->addr);
 	} else if (data->addr.sin_family == AF_INET6) {
 		if (data->addr6.sin6_family != AF_INET6 ||
 	    	    IS_ADDR6_ANY(data->addr6.sin6_addr.s6_addr32)) {
@@ -1875,12 +1864,7 @@
 			s = ERR_PTR(-EINVAL);
 			goto out_free;
 		}
-		server->addr.sin6_family = AF_INET6;
-		server->addr.sin6_port = saddr.sin_port;
-		server->addr.sin6_addr.s6_addr32[0] = 0;
-		server->addr.sin6_addr.s6_addr32[1] = 0;
-		server->addr.sin6_addr.s6_addr32[2] = htonl(0xffff);
-		server->addr.sin6_addr.s6_addr32[3] = saddr.sin_addr.s_addr;
+		map_sockaddr_4to6(&saddr, &server->addr);
 	} else if (data->host_addrlen == sizeof(struct sockaddr_in6)) {
 		if (copy_from_user(&server->addr, data->host_addr, sizeof(server->addr))) {
 			printk(KERN_ERR "NFS: memory fault while copying mount data!\n");
diff -Nru linux-2.6.9-cel5-gq-07/fs/nfsd/nfs4callback.c linux-2.6.9-cel5-gq-08/fs/nfsd/nfs4callback.c
--- linux-2.6.9-cel5-gq-07/fs/nfsd/nfs4callback.c	2005-03-04 09:35:30.666031312 +0100
+++ linux-2.6.9-cel5-gq-08/fs/nfsd/nfs4callback.c	2005-03-04 09:49:32.727018584 +0100
@@ -41,6 +41,7 @@
 #include <linux/sunrpc/xdr.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/state.h>
 #include <linux/sunrpc/sched.h>
@@ -543,6 +544,7 @@
                 .rpc_proc       = &nfs4_cb_null_proc,
                 .rpc_argp       = clp,
         };
+	char hostname[40];
 	int status;
 
 	dprintk("NFSD: probe_callback. cb_parsed %d cb_set %d\n",
@@ -551,10 +553,12 @@
 		return;
 
 	/* Initialize address */
-	memset(&addr, 0, sizeof(addr));
-	addr.sin6_family = AF_INET6;
-	addr.sin6_port = htons(cb->cb_port);
-	memcpy(&addr.sin6_addr, &cb->cb_addr, sizeof(struct in6_addr));
+	map_ipaddr6_to_sockaddr6(&cb->cb_addr, cb->cb_port, &addr);
+
+	// GQ temporary fix for the init of servname, changed in next releases
+	snprintf(hostname, sizeof(hostname),
+		"%x:%x:%x:%x:%x:%x:%x:%x", NIP6(addr.sin6_addr));
+	args.servername = hostname;
 
 	/* Initialize rpc_program */
 	program->name = "nfs4_cb";
diff -Nru linux-2.6.9-cel5-gq-07/fs/nfsd/nfs4state.c linux-2.6.9-cel5-gq-08/fs/nfsd/nfs4state.c
--- linux-2.6.9-cel5-gq-07/fs/nfsd/nfs4state.c	2005-03-04 09:35:30.669030856 +0100
+++ linux-2.6.9-cel5-gq-08/fs/nfsd/nfs4state.c	2005-03-04 09:49:29.368529152 +0100
@@ -44,6 +44,7 @@
 #include <linux/mount.h>
 #include <linux/workqueue.h>
 #include <linux/smp_lock.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/nfs4.h>
 #include <linux/nfsd/state.h>
 #include <linux/nfsd/xdr4.h>
@@ -519,10 +520,7 @@
 		if (shift > 0)
 		shift -= 8;
 	}
-	cbaddrp->s6_addr32[0] = 0;
-	cbaddrp->s6_addr32[1] = 0;
-	cbaddrp->s6_addr32[2] = htonl(0xffff);
-	cbaddrp->s6_addr32[3] = htonl(cbaddr);
+	map_ipaddr_4to6((struct in_addr *)&cbaddr, cbaddrp);
 
 	/* port */
 	shift = 8;
diff -Nru linux-2.6.9-cel5-gq-07/include/linux/nfs_ipv6.h linux-2.6.9-cel5-gq-08/include/linux/nfs_ipv6.h
--- linux-2.6.9-cel5-gq-07/include/linux/nfs_ipv6.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.9-cel5-gq-08/include/linux/nfs_ipv6.h	2005-03-04 09:44:20.518481496 +0100
@@ -0,0 +1,77 @@
+/*
+ *  include/linux/nfs_ipv6.h
+ *
+ *  Macros used to manipulate IPv6 addreses
+ */
+
+#ifndef _LINUX_NFS_IPV6_H
+#define _LINUX_NFS_IPV6_H
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/in.h>
+#include <linux/in6.h>
+
+static inline void
+map_ipaddr_4to6(struct in_addr *addr, struct in6_addr *addr6)
+{
+	addr6->s6_addr32[0] = 0;
+	addr6->s6_addr32[1] = 0;
+	addr6->s6_addr32[2] = htonl(0xffff);
+	addr6->s6_addr32[3] = *(uint32_t *)addr;
+}
+
+static inline void
+map_sockaddr_4to6(struct sockaddr_in *sin, struct sockaddr_in6 *sin6)
+{
+	sin6->sin6_family = AF_INET6;
+	sin6->sin6_port = sin->sin_port;
+	sin6->sin6_flowinfo = 0;
+	map_ipaddr_4to6(&sin->sin_addr, &sin6->sin6_addr);
+	sin6->sin6_scope_id = 0;
+}
+
+static inline void
+map_ipaddr6_to_sockaddr6(struct in6_addr *addr6, __u16 port,
+			 struct sockaddr_in6 *sin6)
+{
+	sin6->sin6_family = AF_INET6;
+	sin6->sin6_port = htons(port);
+	sin6->sin6_flowinfo = 0;
+	memcpy(&sin6->sin6_addr, addr6, sizeof(struct in6_addr));
+	sin6->sin6_scope_id = 0;
+}
+
+static inline void
+init_ipaddr_loopback6(struct in6_addr *addr6)
+{
+	addr6->s6_addr32[0] = 0;
+	addr6->s6_addr32[1] = 0;
+	addr6->s6_addr32[2] = 0;
+	addr6->s6_addr32[3] = htonl(1);
+}
+
+static inline void
+init_sockaddr_loopback6(__u16 port, struct sockaddr_in6 *sin6)
+{
+	sin6->sin6_family = AF_INET6;
+	sin6->sin6_port = htons(port);
+	sin6->sin6_flowinfo = 0;
+	init_ipaddr_loopback6(&sin6->sin6_addr);
+	sin6->sin6_scope_id = 0;
+}
+
+#define IS_ADDR6_LOOPBACK(a) \
+	(((__const uint32_t *) (a))[0] == 0		\
+	 && ((__const uint32_t *) (a))[1] == 0		\
+	 && ((__const uint32_t *) (a))[2] == 0		\
+	 && ((__const uint32_t *) (a))[3] == htonl(1))
+
+#define IS_ADDR6_ANY(a) \
+	(((uint32_t *) (a))[0] == 0			\
+	 && ((uint32_t *) (a))[1] == 0			\
+	 && (((uint32_t *) (a))[2] == 0			\
+	     || ((uint32_t *) (a))[2] == htonl(0xffff))	\
+	 && ((uint32_t *) (a))[3] == 0)
+
+#endif /* _LINUX_NFS_IPV6_H */
diff -Nru linux-2.6.9-cel5-gq-07/include/linux/sunrpc/clnt.h linux-2.6.9-cel5-gq-08/include/linux/sunrpc/clnt.h
--- linux-2.6.9-cel5-gq-07/include/linux/sunrpc/clnt.h	2005-03-04 09:33:01.213751512 +0100
+++ linux-2.6.9-cel5-gq-08/include/linux/sunrpc/clnt.h	2005-03-04 09:45:36.458936792 +0100
@@ -118,7 +118,6 @@
 void		rpc_getport(struct rpc_task *, struct rpc_clnt *);
 void		rpc_getport6(struct rpc_task *, struct rpc_clnt *);
 int		rpc_register(u32, u32, int, unsigned short, int *);
-int		rpc_register6(u32, u32, int, unsigned short, int *);
 
 void		rpc_call_setup(struct rpc_task *, struct rpc_message *, int);
 
diff -Nru linux-2.6.9-cel5-gq-07/include/linux/sunrpc/xprt.h linux-2.6.9-cel5-gq-08/include/linux/sunrpc/xprt.h
--- linux-2.6.9-cel5-gq-07/include/linux/sunrpc/xprt.h	2005-03-04 09:34:32.778831504 +0100
+++ linux-2.6.9-cel5-gq-08/include/linux/sunrpc/xprt.h	2005-03-04 09:46:54.575061336 +0100
@@ -204,8 +204,6 @@
 struct rpc_xprt *	xprt_create_transport(int proto,
 					struct sockaddr *addr, size_t size,
 					struct rpc_timeout *toparms);
-struct rpc_xprt *	xprt_create_proto2(int proto, struct sockaddr *addr,
-					struct rpc_timeout *toparms);
 void			xprt_disconnect(struct rpc_xprt *);
 int			xprt_destroy(struct rpc_xprt *);
 void			xprt_set_timeout(struct rpc_timeout *, unsigned int,
@@ -268,21 +266,6 @@
 	return test_and_clear_bit(XPRT_CONNECTED, &xprt->state);
 }
 
-static inline void map_ipaddr_4to6(struct in_addr *addr, struct in6_addr *addr6)
-{
-	addr6->s6_addr32[0] = 0;
-	addr6->s6_addr32[1] = 0;
-	addr6->s6_addr32[2] = htonl(0xffff);
-	addr6->s6_addr32[3] = *(uint32_t *)addr;
-}
-
-static inline void map_sockaddr_4to6(struct sockaddr_in *sin, struct sockaddr_in6 *sin6)
-{
-	sin6->sin6_family = AF_INET6;
-	sin6->sin6_port = sin->sin_port;
-	map_ipaddr_4to6(&sin->sin_addr, &sin6->sin6_addr);
-}
-
 #endif /* __KERNEL__*/
 
 #endif /* _LINUX_SUNRPC_XPRT_H */
diff -Nru linux-2.6.9-cel5-gq-07/net/sunrpc/pmap_clnt.c linux-2.6.9-cel5-gq-08/net/sunrpc/pmap_clnt.c
--- linux-2.6.9-cel5-gq-07/net/sunrpc/pmap_clnt.c	2005-03-04 09:39:29.018796184 +0100
+++ linux-2.6.9-cel5-gq-08/net/sunrpc/pmap_clnt.c	2005-03-04 09:48:12.515212632 +0100
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 
+#include <linux/nfs_ipv6.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/xprt.h>
 #include <linux/sunrpc/sched.h>
@@ -29,10 +30,10 @@
 #define PMAP_UNSET		2
 #define PMAP_GETPORT		3
 
-static struct rpc_procinfo	pmap_procedures[];
-static struct rpc_clnt *	pmap_create(char *, struct sockaddr_in *, int);
-static void			pmap_getport_done(struct rpc_task *);
+struct rpc_clnt *		pmap_create(char *, struct sockaddr_in6 *, int);
+void				pmap_getport_done(struct rpc_task *);
 extern struct rpc_program	pmap_program;
+struct rpc_procinfo		pmap_procedures[];
 
 static inline void __wake_up_portmap_waiters(struct rpc_xprt *xprt)
 {
@@ -50,7 +51,7 @@
 {
 	struct rpc_xprt *xprt = clnt->cl_xprt;
 	struct rpc_portmap *map = &xprt->pmap;
-	struct sockaddr_in addr;
+	struct sockaddr_in6 addr;
 	struct rpc_message msg = {
 		.rpc_proc	= &pmap_procedures[PMAP_GETPORT],
 		.rpc_argp	= map,
@@ -111,6 +112,7 @@
 		.pm_prot	= prot,
 		.pm_port	= 0
 	};
+	struct sockaddr_in6 sin6;
 	struct rpc_clnt	*pmap_clnt;
 	char		hostname[32];
 	int		status;
@@ -118,6 +120,7 @@
 	dprintk("RPC:       rpc_getport_external(%u.%u.%u.%u, %u, %u, %d)\n",
 			NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);
 
+	map_sockaddr_4to6(sin, &sin6);
 	pmap_clnt = pmap_create(hostname, &sin, prot);
 	if (IS_ERR(pmap_clnt))
 		return PTR_ERR(pmap_clnt);
@@ -134,7 +137,7 @@
 }
 #endif
 
-static void
+void
 pmap_getport_done(struct rpc_task *task)
 {
 	struct rpc_clnt	*clnt = task->tk_client;
@@ -152,8 +155,10 @@
 		/* Program not registered */
 		task->tk_status = -EACCES;
 		task->tk_action = NULL;
-	} else
+	} else {
 		xprt->ops->set_port(xprt, map->pm_port);
+		xprt->need_bind = 0;
+	}
 
 	__wake_up_portmap_waiters(xprt);
 }
@@ -165,7 +170,7 @@
 int
 rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)
 {
-	struct sockaddr_in	sin;
+	struct sockaddr_in6	sin;
 	struct rpc_portmap	map;
 	struct rpc_clnt		*pmap_clnt;
 	int error = 0;
@@ -173,8 +178,7 @@
 	dprintk("RPC:       registering (%u, %u, %d, %u) with portmapper.\n",
 			prog, vers, prot, port);
 
-	sin.sin_family = AF_INET;
-	sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+	init_sockaddr_loopback6(0, &sin);
 	pmap_clnt = pmap_create("localhost", &sin, IPPROTO_UDP);
 	if (IS_ERR(pmap_clnt)) {
 		error = PTR_ERR(pmap_clnt);
@@ -201,7 +205,7 @@
 	return error;
 }
 
-static struct rpc_clnt * pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto)
+struct rpc_clnt * pmap_create(char *hostname, struct sockaddr_in6 *srvaddr, int proto)
 {
 	struct rpc_create_args args = {
 		.protocol	= proto,
@@ -215,7 +219,7 @@
 					RPC_CLNT_ONESHOT,
 	};
 
-	srvaddr->sin_port = htons(RPC_PMAP_PORT);
+	srvaddr->sin6_port = htons(RPC_PMAP_PORT);
 	return rpc_create(&args);
 }
 
@@ -250,7 +254,7 @@
 	return 0;
 }
 
-static struct rpc_procinfo	pmap_procedures[] = {
+struct rpc_procinfo	pmap_procedures[] = {
 [PMAP_SET] = {
 	  .p_proc		= PMAP_SET,
 	  .p_encode		= (kxdrproc_t) xdr_encode_mapping,	
diff -Nru linux-2.6.9-cel5-gq-07/net/sunrpc/rpcb_clnt.c linux-2.6.9-cel5-gq-08/net/sunrpc/rpcb_clnt.c
--- linux-2.6.9-cel5-gq-07/net/sunrpc/rpcb_clnt.c	2005-03-04 09:39:29.018796184 +0100
+++ linux-2.6.9-cel5-gq-08/net/sunrpc/rpcb_clnt.c	2005-03-04 09:49:22.082636776 +0100
@@ -1,7 +1,7 @@
 /*
- * linux/net/sunrpc/pmap.c
+ * linux/net/sunrpc/rpcb_clnt.c
  *
- * Portmapper client.
+ * Rpcbind client.
  *
  * FIXME: In a secure environment, we may want to use an authentication
  * flavor other than AUTH_NULL.
@@ -42,6 +42,8 @@
 	char r_addr[40];
 };
 
+static void (*action)(struct rpc_task *);
+
 static inline void __wake_up_portmap_waiters(struct rpc_xprt *xprt)
 {
 	smp_mb__before_clear_bit();
@@ -70,6 +72,7 @@
 			task->tk_pid, clnt->cl_server, clnt->cl_prog,
 			clnt->cl_vers, xprt->prot);
 
+	action = task->tk_action;
 	if (test_and_set_bit(XPRT_BINDING, &xprt->state)) {
 		rpc_sleep_on(&xprt->bindwait, task, NULL, NULL);
 		return;
@@ -79,9 +82,11 @@
 	map->pm_vers = rpcb_req.r_vers = clnt->cl_vers;
 	map->pm_prot = xprt->prot;
 	rpc_peeraddr(clnt, &addr, sizeof(addr));
-	sprintf(str, "%x:%x:%x:%x:%x:%x:%x:%x",
+	snprintf(str, sizeof(str),
+		"%x:%x:%x:%x:%x:%x:%x:%x",
 		NIP6(addr.sin6_addr));
 	memcpy(rpcb_req.r_addr, str, strlen(str));
+	rpcb_req.r_addr[strlen(str)] = '\0';
 
 	rpcb_clnt = rpcb_create6(clnt->cl_server, &addr, xprt->prot);
 	if (IS_ERR(rpcb_clnt)) {
@@ -121,15 +126,26 @@
 			task->tk_pid, task->tk_status, map->pm_port);
 
 	xprt->ops->set_port(xprt, 0);
-	if (task->tk_status < 0) {
+	if (task->tk_status == -EIO) {
+		/* try with portmapper v2 */
+		task->tk_status = 0;
+		task->tk_action = action;
+		smp_mb__before_clear_bit();
+		clear_bit(XPRT_BINDING, &xprt->state);
+		smp_mb__after_clear_bit();
+		rpc_getport(task, clnt);
+		return;
+	} else if (task->tk_status < 0) {
 		/* Make the calling task exit with an error */
 		task->tk_action = NULL;
 	} else if (map->pm_port == 0) {
 		/* Program not registered */
 		task->tk_status = -EACCES;
 		task->tk_action = NULL;
-	} else
+	} else {
 		xprt->ops->set_port(xprt, map->pm_port);
+		xprt->need_bind = 0;
+	}
 
 	__wake_up_portmap_waiters(xprt);
 }
@@ -189,7 +205,7 @@
 	char netid[] = "tcp6";
 	char owner[] = "rpcb";
 
-	dprintk("RPC:       xdr_encode_getport(%u, %u, %s)\n",
+	dprintk("RPC:       xdr_encode_getaddr(%u, %u, %s)\n",
 		rpcb->r_prog, rpcb->r_vers, rpcb->r_addr);
 	*p++ = htonl(rpcb->r_prog);
 	*p++ = htonl(rpcb->r_vers);
diff -Nru linux-2.6.9-cel5-gq-07/net/sunrpc/rpc_pipe.c linux-2.6.9-cel5-gq-08/net/sunrpc/rpc_pipe.c
--- linux-2.6.9-cel5-gq-07/net/sunrpc/rpc_pipe.c	2005-03-04 09:34:32.779831352 +0100
+++ linux-2.6.9-cel5-gq-08/net/sunrpc/rpc_pipe.c	2005-03-04 09:47:43.857569256 +0100
@@ -23,7 +23,7 @@
 #include <linux/poll.h>
 #include <linux/wait.h>
 #include <linux/seq_file.h>
-#include <linux/in.h>
+#include <linux/in6.h>
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/workqueue.h>
diff -Nru linux-2.6.9-cel5-gq-07/net/sunrpc/svcauth_unix.c linux-2.6.9-cel5-gq-08/net/sunrpc/svcauth_unix.c
--- linux-2.6.9-cel5-gq-07/net/sunrpc/svcauth_unix.c	2005-03-04 09:34:57.161124832 +0100
+++ linux-2.6.9-cel5-gq-08/net/sunrpc/svcauth_unix.c	2005-03-04 09:49:07.901792592 +0100
@@ -8,7 +8,7 @@
 #include <linux/err.h>
 #include <linux/seq_file.h>
 #include <linux/hash.h>
-#include <linux/in6.h>
+#include <linux/nfs_ipv6.h>
 #include <linux/ipv6.h>
 
 #define RPCDBG_FACILITY	RPCDBG_AUTH
@@ -43,13 +43,10 @@
 
 	ud.name = name;
 	
-	dprintk("unix_domain_find: name = %s\n", name);
 	rv = auth_domain_lookup(&ud, 0);
-	dprintk("unix_domain_find: return from auth_domain_lookup = %x, domain %s found\n", rv, rv ? "" : "not");
 
  foundit:
 	if (rv && rv->flavour != RPC_AUTH_UNIX) {
-		dprintk("unix_domain_find: rv->flavour (%d) != RPC_AUTH_UNIX)\n", rv->flavour);
 		auth_domain_put(rv);
 		return NULL;
 	}
@@ -66,12 +63,9 @@
 	new->h.h.expiry_time = NEVER;
 
 	rv = auth_domain_lookup(&new->h, 2);
-	dprintk("unix_domain_find: return from auth_domain_lookup (2) = %x, domain %s found\n", rv, rv ? "" : "not");
 	if (rv == &new->h) {
-		dprintk("unix_domain_find: call atomic_dec_and_test()\n");
 		if (atomic_dec_and_test(&new->h.h.refcnt)) BUG();
 	} else {
-		dprintk("unix_domain_find: call auth_domain_put()\n");
 		auth_domain_put(&new->h);
 		goto foundit;
 	}
@@ -111,7 +105,6 @@
 	if (cache_put(item, cd)) {
 		if (test_bit(CACHE_VALID, &item->flags) &&
 		    !test_bit(CACHE_NEGATIVE, &item->flags))
-			dprintk("ip_map_put: call auth_domain_put()\n");
 			auth_domain_put(&im->m_client->h);
 		kfree(im);
 	}
@@ -181,7 +174,6 @@
 	len = qword_get(&mesg, buf, 50);
 	if (len <= 0) return -EINVAL;
 
-	dprintk("ip_map_parse: addr buf = %s\n", buf);
 	if (sscanf(buf, "%x:%x:%x:%x:%x:%x:%x:%x%c",
 		   &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) != 8)
 		return -EINVAL;
@@ -192,12 +184,10 @@
 
 	/* domainname, or empty for NEGATIVE */
 	len = qword_get(&mesg, buf, 50);
-	dprintk("ip_map_parse: domain buf = %s\n", buf);
 	if (len < 0) return -EINVAL;
 
 	if (len) {
 		dom = unix_domain_find(buf);
-		dprintk("ip_map_parse: call unix_domain_find() , dom = %x\n", dom);
 		if (dom == NULL)
 			return -ENOENT;
 	} else
@@ -212,14 +202,11 @@
 	if (dom) {
 		ipm.m_client = container_of(dom, struct unix_domain, h);
 		ipm.m_add_change = ipm.m_client->addr_changes;
-	} else {
-	    	dprintk("ip_map_parse: dom NULL !!!!\n");
+	} else
 		set_bit(CACHE_NEGATIVE, &ipm.h.flags);
-	}
 	ipm.h.expiry_time = expiry;
 
 	ipmp = ip_map_lookup(&ipm, 1);
-	dprintk("ip_map_parse: call ip_map_lookup(), ipmp = %x => ipmap %s found\n", ipmp, ipmp ? "" : "not");
 	if (ipmp)
 		ip_map_put(&ipmp->h, &ip_map_cache);
 	if (dom)
@@ -249,7 +236,6 @@
 	if (test_bit(CACHE_VALID, &h->flags) && 
 	    !test_bit(CACHE_NEGATIVE, &h->flags)) 
 		dom = im->m_client->h.name;
-	dprintk("ip_map_show: dom = %s\n", dom);
 
 	seq_printf(m, "%s %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x %s\n", im->m_class, NIP6(addr), dom);
 	dprintk("ip_map_show: seq = %s %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x %s\n", im->m_class, NIP6(addr), dom);
@@ -297,11 +283,7 @@
 {
 	struct in6_addr addr6;
 
-	addr6.s6_addr32[0] = 0;
-	addr6.s6_addr32[1] = 0;
-	addr6.s6_addr32[2] = htonl(0xffff);
-	addr6.s6_addr32[3] = *(uint32_t *)&addr;
-
+	map_ipaddr_4to6(&addr, &addr6);
 	return auth_unix_add_addr6(&addr6, dom);
 }
 
@@ -347,11 +329,7 @@
 {
 	struct in6_addr addr6;
 
-	addr6.s6_addr32[0] = 0;
-	addr6.s6_addr32[1] = 0;
-	addr6.s6_addr32[2] = htonl(0xffff);
-	addr6.s6_addr32[3] = *(uint32_t *)&addr;
-
+	map_ipaddr_4to6(&addr, &addr6);
 	return auth_unix_lookup6(&addr6);
 }
 
@@ -403,7 +381,6 @@
 	cred->cr_group_info = NULL;
 	rqstp->rq_client = NULL;
 
-	dprintk("svcauth_null_accept:\n");
 	if (argv->iov_len < 3*4)
 		return SVC_GARBAGE;
 
@@ -482,7 +459,6 @@
 	svc_getu32(argv);			/* length */
 	svc_getu32(argv);			/* time stamp */
 	slen = XDR_QUADLEN(ntohl(svc_getu32(argv)));	/* machname length */
-	dprintk("svcauth_unix_accept: svc slen = %d\n", slen);
 	if (slen > 64 || (len -= (slen + 3)*4) < 0)
 		goto badcred;
 	argv->iov_base = (void*)((u32*)argv->iov_base + slen);	/* skip machname */
@@ -491,7 +467,6 @@
 	cred->cr_uid = ntohl(svc_getu32(argv));		/* uid */
 	cred->cr_gid = ntohl(svc_getu32(argv));		/* gid */
 	slen = ntohl(svc_getu32(argv));			/* gids length */
-	dprintk("svcauth_unix_accept: cred slen = %d\n", slen);
 	if (slen > 16 || (len -= (slen + 2)*4) < 0)
 		goto badcred;
 	cred->cr_group_info = groups_alloc(slen);
diff -Nru linux-2.6.9-cel5-gq-07/net/sunrpc/xprtsock.c linux-2.6.9-cel5-gq-08/net/sunrpc/xprtsock.c
--- linux-2.6.9-cel5-gq-07/net/sunrpc/xprtsock.c	2005-03-04 09:39:29.165773840 +0100
+++ linux-2.6.9-cel5-gq-08/net/sunrpc/xprtsock.c	2005-03-04 09:49:18.770140352 +0100
@@ -1153,23 +1153,9 @@
  */
 static void xs_set_port(struct rpc_xprt *xprt, u16 port)
 {
-	struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr;
-	dprintk("RPC:       setting port for xprt %p to %d\n",
-			xprt, sap->sin_port);
-	sap->sin_port = htons(port);
-}
-
-/**
- * xs_set_port6 - reset the port number in the remote endpoint address
- * @xprt: generic transport
- * @port: new port number
- *
- */
-static void xs_set_port6(struct rpc_xprt *xprt, u16 port)
-{
 	struct sockaddr_in6 *sap = (struct sockaddr_in6 *) &xprt->addr;
 	dprintk("RPC:       setting port for xprt %p to %d\n",
-			xprt, sap->sin6_port);
+			xprt, port);
 	sap->sin6_port = htons(port);
 }
 
@@ -1180,11 +1166,11 @@
  */
 static int xs_is_bound(struct rpc_xprt *xprt)
 {
-	struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr;
-	int is_bound = (sap->sin_port != 0) && (xprt->need_bind == 0);
+	struct sockaddr_in6 *sap = (struct sockaddr_in6 *) &xprt->addr;
+	int is_bound = (sap->sin6_port != 0) && (xprt->need_bind == 0);
 	dprintk("RPC:       xprt %p is %sbound: port=%d, need_bind=%d\n",
-			xprt, (is_bound ? "" : "not "), sap->sin_port,
-				xprt->need_bind);
+			xprt, (is_bound ? "" : "not "),
+			htons(sap->sin6_port), xprt->need_bind);
 	return is_bound;
 }
 
@@ -1220,38 +1206,7 @@
 }
 
 /**
- * xs_bindrevport6 - bind to a reserved IPv6 port number
- * @priv: private transport structure
- * @sock: socket to bind
- *
- */
-static int xs_bindresvport6(struct xs_private *priv, struct socket *sock)
-{
-	struct sockaddr_in6 myaddr = {
-		.sin6_family = AF_INET6,
-	};
-	int		err, port;
-
-	/* Were we already bound to a given port? Try to reuse it */
-	port = priv->port;
-	do {
-		myaddr.sin6_port = htons(port);
-		err = sock->ops->bind(sock, (struct sockaddr *) &myaddr,
-						sizeof(myaddr));
-		if (err == 0) {
-			priv->port = port;
-			return 0;
-		}
-		if (--port == 0)
-			port = XS_MAX_RESVPORT;
-	} while (err == -EADDRINUSE && port != priv->port);
-
-	printk(KERN_ERR "RPC: Can't bind to reserved port (%d).\n", -err);
-	return err;
-}
-
-/**
- * xs_udp_connect_worker - set up a UDP over IPv4 socket
+ * xs_udp_connect_worker - set up a UDP socket
  * @args: RPC transport to connect
  *
  * Invoked by a work queue tasklet.
@@ -1317,73 +1272,7 @@
 }
 
 /**
- * xs_udp6_connect_worker - set up a UDP over IPv6 socket
- * @args: RPC transport to connect
- *
- * Invoked by a work queue tasklet.
- */
-static void xs_udp6_connect_worker(void *args)
-{
-	struct rpc_xprt	*xprt = (struct rpc_xprt *)args;
-	struct xs_private *priv = xs_private_data(xprt);
-	struct socket	*sock = priv->sock;
-	int		err, status = -EIO;
-
-	if (xprt->shutdown || !xprt_is_bound(xprt))
-		goto out;
-
-	dprintk("RPC:       xs_udp6_connect_worker for xprt %p\n", xprt);
-
-	/* Start by resetting any existing state */
-	xs_close(xprt);
-
-	if ((err = sock_create(PF_INET6, SOCK_DGRAM, IPPROTO_UDP, &sock)) < 0) {
-		printk(KERN_ERR "RPC: can't create socket (%d).\n", -err);
-		goto out;
-	}
-
-	if (xprt->resvport && xs_bindresvport6(priv, sock) < 0) {
-		printk(KERN_ERR "RPC: can't bind to reserved port.\n");
-		sock_release(sock);
-		goto out;
-	}
-
-	if (!priv->inet) {
-		struct sock     *sk = sock->sk;
-
-		write_lock_bh(&sk->sk_callback_lock);
-
-		sk->sk_user_data = xprt;
-		priv->old_data_ready = sk->sk_data_ready;
-		priv->old_state_change = sk->sk_state_change;
-		priv->old_write_space = sk->sk_write_space;
-		sk->sk_data_ready = xs_udp_data_ready;
-		sk->sk_write_space = xs_udp_write_space;
-		sk->sk_no_check = UDP_CSUM_NORCV;
-
-		xprt_set_connected(xprt);
-
-		/* Reset to new socket */
-		priv->sock = sock;
-		priv->inet = sk;
-
-		write_unlock_bh(&sk->sk_callback_lock);
-	}
-	xs_udp_do_setbufsize(xprt);
-	status = 0;
-out:
-	if (status < 0)
-		rpc_wake_up_status(&xprt->pending, status);
-	else
-		rpc_wake_up(&xprt->pending);
-
-	smp_mb__before_clear_bit();
-	clear_bit(XPRT_CONNECTING, &xprt->state);
-	smp_mb__after_clear_bit();
-}
-
-/**
- * xs_tcp_connect_worker - connect a TCP over IPv4 socket to a remote endpoint
+ * xs_tcp_connect_worker - connect a TCP socket to a remote endpoint
  * @args: RPC transport to connect
  *
  * Invoked by a work queue tasklet.
@@ -1466,89 +1355,6 @@
 }
 
 /**
- * xs_tcp6_connect_worker - connect a TCP over IPv6 socket to a remote endpoint
- * @args: RPC transport to connect
- *
- * Invoked by a work queue tasklet.
- */
-static void xs_tcp6_connect_worker(void *args)
-{
-	struct rpc_xprt	*xprt = (struct rpc_xprt *)args;
-	struct xs_private *priv = xs_private_data(xprt);
-	struct socket	*sock = priv->sock;
-	int		err, status = -EIO;
-
-	if (xprt->shutdown || !xprt_is_bound(xprt))
-		goto out;
-
-	dprintk("RPC:       xs_tcp6_connect_worker for xprt %p\n", xprt);
-
-	/* Start by resetting any existing state */
-	xs_close(xprt);
-
-	if ((err = sock_create(PF_INET6, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) {
-		printk(KERN_ERR "RPC: can't create socket (%d).\n", -err);
-		goto out;
-	}
-
-	if (xprt->resvport && xs_bindresvport6(priv, sock) < 0) {
-		printk(KERN_ERR "RPC: can't bind to reserved port.\n");
-		sock_release(sock);
-		goto out;
-	}
-
-	if (!priv->inet) {
-		struct sock     *sk = sock->sk;
-
-		write_lock_bh(&sk->sk_callback_lock);
-
-		sk->sk_user_data = xprt;
-		priv->old_data_ready = sk->sk_data_ready;
-		priv->old_state_change = sk->sk_state_change;
-		priv->old_write_space = sk->sk_write_space;
-		sk->sk_data_ready = xs_tcp_data_ready;
-		sk->sk_state_change = xs_tcp_state_change;
-		sk->sk_write_space = xs_tcp_write_space;
-
-		xprt_clear_connected(xprt);
-
-		/* Reset to new socket */
-		priv->sock = sock;
-		priv->inet = sk;
-
-		write_unlock_bh(&sk->sk_callback_lock);
-	}
-
-	/* Tell the socket layer to start connecting... */
-	status = sock->ops->connect(sock, (struct sockaddr *) &xprt->addr,
-			sizeof(xprt->addr), O_NONBLOCK);
-	dprintk("RPC:       %p connect status %d connected %d sock state %d\n",
-			xprt, -status, xprt_connected(xprt),
-			sock->sk->sk_state);
-	if (status < 0) {
-		switch (status) {
-			case -EINPROGRESS:
-			case -EALREADY:
-				goto out_clear;
-		}
-	}
-
-out:
-	if (status < 0) {
-		xprt->reestablish_timeout <<= 1;
-		if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO)
-			xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO;
-		rpc_wake_up_status(&xprt->pending, status);
-	} else
-		rpc_wake_up(&xprt->pending);
-
-out_clear:
-	smp_mb__before_clear_bit();
-	clear_bit(XPRT_CONNECTING, &xprt->state);
-	smp_mb__after_clear_bit();
-}
-
-/**
  * xs_connect - connect an IPv4 socket to a remote endpoint
  * @task: address of RPC task that manages state of connect request
  *
@@ -1586,24 +1392,8 @@
 static struct rpc_xprt_ops	xs_udp_ops = {
 	.setbufsize	= xs_udp_setbufsize,
 	.is_bound	= xs_is_bound,
-	.bind		= rpc_getport,
-	.set_port	= xs_set_port,
-	.connect	= xs_connect,
-	.buf_alloc	= rpc_malloc,
-	.buf_free	= rpc_free,
-	.send_request	= xs_udp_send_request,
-	.set_receive_timeout	= xs_udp_set_receive_timeout,
-	.is_congested	= xs_udp_is_congested,
-	.timeout	= xs_udp_timeout,
-	.close		= xs_close,
-	.destroy	= xs_destroy,
-};
-
-static struct rpc_xprt_ops	xs_udp6_ops = {
-	.setbufsize	= xs_udp_setbufsize,
-	.is_bound	= xs_is_bound,
 	.bind		= rpc_getport6,
-	.set_port	= xs_set_port6,
+	.set_port	= xs_set_port,
 	.connect	= xs_connect,
 	.buf_alloc	= rpc_malloc,
 	.buf_free	= rpc_free,
@@ -1618,24 +1408,8 @@
 static struct rpc_xprt_ops	xs_tcp_ops = {
 	.setbufsize	= xs_tcp_setbufsize,
 	.is_bound	= xs_is_bound,
-	.bind		= rpc_getport,
-	.set_port	= xs_set_port,
-	.connect	= xs_connect,
-	.buf_alloc	= rpc_malloc,
-	.buf_free	= rpc_free,
-	.send_request	= xs_tcp_send_request,
-	.set_receive_timeout	= xs_tcp_set_receive_timeout,
-	.is_congested   = xs_tcp_is_congested,
-	.timeout	= xs_tcp_timeout,
-	.close		= xs_close,
-	.destroy	= xs_destroy,
-};
-
-static struct rpc_xprt_ops	xs_tcp6_ops = {
-	.setbufsize	= xs_tcp_setbufsize,
-	.is_bound	= xs_is_bound,
 	.bind		= rpc_getport6,
-	.set_port	= xs_set_port6,
+	.set_port	= xs_set_port,
 	.connect	= xs_connect,
 	.buf_alloc	= rpc_malloc,
 	.buf_free	= rpc_free,
@@ -1701,56 +1475,6 @@
 }
 
 /**
- * xs_setup_udp6 - Set up transport to use a UDP over IPv6 socket
- * @xprt: transport to set up
- * @to:   timeout parameters
- *
- */
-static int xs_setup_udp6(struct rpc_xprt *xprt, struct rpc_timeout *to)
-{
-	struct xs_private *priv;
-
-	dprintk("RPC:       setting up udp-ipv6 transport...\n");
-
-	xprt->max_reqs = xprt_udp_slot_table_entries;
-
-	priv = kmalloc(sizeof(struct xs_private), GFP_KERNEL);
-	if (priv == NULL)
-		return -ENOMEM;
-	memset(priv, 0, sizeof(struct xs_private));
-	xprt->transport_data = priv;
-
-	xprt->prot = IPPROTO_UDP;
-	priv->port = XS_MAX_RESVPORT;
-	xprt->tsh_size = 0;
-	xprt->cwnd = RPC_INITCWND;
-	xprt->resvport = capable(CAP_NET_BIND_SERVICE) ? 1 : 0;
-	/* XXX: header size can vary due to auth type, IPv6, etc.
-	 *      so this is a guess.  */
-	xprt->max_payload = (1U << 16) - (MAX_HEADER << 3);
-
-	INIT_WORK(&priv->sock_connect, xs_udp6_connect_worker, xprt);
-	xprt->bind_timeout = XS_BIND_TO;
-	xprt->connect_timeout = XS_UDP_CONN_TO;
-	xprt->reestablish_timeout = XS_UDP_REEST_TO;
-	xprt->idle_timeout = XS_IDLE_TO;
-
-	xprt->ops = &xs_udp6_ops;
-
-	if (to)
-		xprt->timeout = *to;
-	else
-		xprt_set_timeout(&xprt->timeout, 5, 5 * HZ);
-
-	if (try_module_get(THIS_MODULE))
-		return 0;
-
-	kfree(priv);
-	xprt->transport_data = NULL;
-	return -EINVAL;
-}
-
-/**
  * xs_setup_tcp - Set up transport to use a TCP over IPv4 socket
  * @xprt: transport to set up
  * @to: timeout parameters
@@ -1798,54 +1522,6 @@
 	return -EINVAL;
 }
 
-/**
- * xs_setup_tcp6 - Set up transport to use a TCP over IPv6 socket
- * @xprt: transport to set up
- * @to: timeout parameters
- *
- */
-static int xs_setup_tcp6(struct rpc_xprt *xprt, struct rpc_timeout *to)
-{
-	struct xs_private *priv;
-
-	dprintk("RPC:       setting up tcp-ipv6 transport...\n");
-
-	xprt->max_reqs = xprt_tcp_slot_table_entries;
-
-	priv = kmalloc(sizeof(struct xs_private), GFP_KERNEL);
-	if (priv == NULL)
-		return -ENOMEM;
-	memset(priv, 0, sizeof(struct xs_private));
-	xprt->transport_data = priv;
-
-	xprt->prot = IPPROTO_TCP;
-	priv->port = XS_MAX_RESVPORT;
-	xprt->tsh_size = sizeof(rpc_fraghdr);
-	xprt->cwnd = RPC_MAXCWND(xprt);
-	xprt->resvport = capable(CAP_NET_BIND_SERVICE) ? 1 : 0;
-	xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
-
-	INIT_WORK(&priv->sock_connect, xs_tcp6_connect_worker, xprt);
-	xprt->bind_timeout = XS_BIND_TO;
-	xprt->connect_timeout = XS_TCP_CONN_TO;
-	xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
-	xprt->idle_timeout = XS_IDLE_TO;
-
-	xprt->ops = &xs_tcp6_ops;
-
-	if (to)
-		xprt->timeout = *to;
-	else
-		xprt_set_timeout(&xprt->timeout, 2, 60 * HZ);
-
-	if (try_module_get(THIS_MODULE))
-		return 0;
-
-	kfree(priv);
-	xprt->transport_data = NULL;
-	return -EINVAL;
-}
-
 static struct xprt_type	xs_udp_type = {
 	.list		= LIST_HEAD_INIT(xs_udp_type.list),
 	.name		= "udp-ipv4",
@@ -1861,7 +1537,7 @@
 	.owner		= THIS_MODULE,
 	.family		= AF_INET6,
 	.protocol	= IPPROTO_UDP,
-	.setup		= xs_setup_udp6,
+	.setup		= xs_setup_udp,
 };
 
 static struct xprt_type	xs_tcp_type = {
@@ -1879,7 +1555,7 @@
 	.owner		= THIS_MODULE,
 	.family		= AF_INET6,
 	.protocol	= IPPROTO_TCP,
-	.setup		= xs_setup_tcp6,
+	.setup		= xs_setup_tcp,
 };
 
 /**
