diff -u -r -N linux-2.6.21-IPv6-05/net/sunrpc/svcauth_unix.c linux-2.6.21-IPv6-06/net/sunrpc/svcauth_unix.c
--- linux-2.6.21-IPv6-05/net/sunrpc/svcauth_unix.c	2007-06-05 10:56:57.000000000 +0200
+++ linux-2.6.21-IPv6-06/net/sunrpc/svcauth_unix.c	2007-07-02 14:46:58.000000000 +0200
@@ -10,7 +10,7 @@
 #include <linux/hash.h>
 #include <linux/string.h>
 #include <net/sock.h>
-
+#include <linux/nfs_ipv6>
 #define RPCDBG_FACILITY	RPCDBG_AUTH
 
 
@@ -83,7 +83,7 @@
 struct ip_map {
 	struct cache_head	h;
 	char			m_class[8]; /* e.g. "nfsd" */
-	struct in_addr		m_addr;
+	struct in6_addr		m_addr;
 	struct unix_domain	*m_client;
 	int			m_add_change;
 };
@@ -111,12 +111,17 @@
 	return (hash ^ (hash>>8)) & 0xff;
 }
 #endif
+
+static inline int hash_ip(struct in6_addr ip)
+	int hash = ip.s6_addr[0] ^ ip.s6_addr[1] ^ ip.s6_addr[2] ^ ip.s6_addr[3];
+	return hash;
+
 static int ip_map_match(struct cache_head *corig, struct cache_head *cnew)
 {
 	struct ip_map *orig = container_of(corig, struct ip_map, h);
 	struct ip_map *new = container_of(cnew, struct ip_map, h);
 	return strcmp(orig->m_class, new->m_class) == 0
-		&& orig->m_addr.s_addr == new->m_addr.s_addr;
+		&& memcmp(orig->m_addr.s6_addr,new->m_addr.s6_addr,sizeof(struct s6_addr));
 }
 static void ip_map_init(struct cache_head *cnew, struct cache_head *citem)
 {
@@ -124,7 +129,7 @@
 	struct ip_map *item = container_of(citem, struct ip_map, h);
 
 	strcpy(new->m_class, item->m_class);
-	new->m_addr.s_addr = item->m_addr.s_addr;
+	memcpy(new->m_addr.s6_addr,item->m_addr.s6_addr,sizeof(struct in6_addr));
 }
 static void update(struct cache_head *cnew, struct cache_head *citem)
 {
@@ -150,20 +155,27 @@
 {
 	char text_addr[20];
 	struct ip_map *im = container_of(h, struct ip_map, h);
-	__be32 addr = im->m_addr.s_addr;
+	__be32 addr;
+	int i;
+	for (i=0;i<4;i++)
+		addr[i] = im->m_addr.s6_addr[i];
 
-	snprintf(text_addr, 20, "%u.%u.%u.%u",
-		 ntohl(addr) >> 24 & 0xff,
-		 ntohl(addr) >> 16 & 0xff,
-		 ntohl(addr) >>  8 & 0xff,
-		 ntohl(addr) >>  0 & 0xff);
+	snprintf(text_addr, 20, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
+		 ntohl(addr[3]) >> 16 & 0xff,
+                 ntohl(addr[3]) >>  0 & 0xff,
+		 ntohl(addr[2]) >> 16 & 0xff,
+                 ntohl(addr[2]) >>  0 & 0xff,
+		 ntohl(addr[1]) >> 16 & 0xff,
+                 ntohl(addr[1]) >>  0 & 0xff,
+		 ntohl(addr[0]) >> 16 & 0xff,
+		 ntohl(addr[0]) >>  0 & 0xff;
 
 	qword_add(bpp, blen, im->m_class);
 	qword_add(bpp, blen, text_addr);
 	(*bpp)[-1] = '\n';
 }
 
-static struct ip_map *ip_map_lookup(char *class, struct in_addr addr);
+static struct ip_map *ip_map_lookup(char *class, struct in6_addr addr);
 static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
 
 static int ip_map_parse(struct cache_detail *cd,
@@ -174,10 +186,10 @@
 	 * for scratch: */
 	char *buf = mesg;
 	int len;
-	int b1,b2,b3,b4;
+	int b1,b2,b3,b4,b5,b6,b7,b8;
 	char c;
 	char class[8];
-	struct in_addr addr;
+	struct in6_addr addr;
 	int err;
 
 	struct ip_map *ipmp;
@@ -196,9 +208,21 @@
 	len = qword_get(&mesg, buf, mlen);
 	if (len <= 0) return -EINVAL;
 
-	if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4)
-		return -EINVAL;
-
+	if (sscanf(buf, "%d.%d.%d.%d%c", &b1, &b2, &b3, &b4, &c) == 4) {
+		ipm.m_addr.s6_addr32[0] = 0;
+               	ipm.m_addr.s6_addr32[1] = 0;
+		ipm.m_addr.s6_addr32[2] = htonl(0xffff);
+		ipm.m_addr.s6_addr32[3] =
+		htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4);
+       } else if (sscanf(buf, "%x:%x:%x:%x:%x:%x:%x:%x%c",
+                         &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) == 8) {
+		ipm.m_addr.s6_addr32[0] = htonl((b1<<16)|b2);
+		ipm.m_addr.s6_addr32[1] = htonl((b3<<16)|b4);
+		ipm.m_addr.s6_addr32[2] = htonl((b5<<16)|b6);
+		ipm.m_addr.s6_addr32[3] = htonl((b7<<16)|b8);
+	} else
+                return -EINVAL;
+	
 	expiry = get_expiry(&mesg);
 	if (expiry ==0)
 		return -EINVAL;
@@ -279,16 +303,16 @@
 	.alloc		= ip_map_alloc,
 };
 
-static struct ip_map *ip_map_lookup(char *class, struct in_addr addr)
+static struct ip_map *ip_map_lookup(char *class, struct in6_addr addr)
 {
 	struct ip_map ip;
 	struct cache_head *ch;
 
 	strcpy(ip.m_class, class);
-	ip.m_addr = addr;
+	memcpy(&ip.m_addr, &addr, sizeof strcut in6_addr);
 	ch = sunrpc_cache_lookup(&ip_map_cache, &ip.h,
 				 hash_str(class, IP_HASHBITS) ^
-				 hash_ip(addr.s_addr));
+				 hash_ip(addr));
 
 	if (ch)
 		return container_of(ch, struct ip_map, h);
@@ -317,14 +341,14 @@
 	ch = sunrpc_cache_update(&ip_map_cache,
 				 &ip.h, &ipm->h,
 				 hash_str(ipm->m_class, IP_HASHBITS) ^
-				 hash_ip(ipm->m_addr.s_addr));
+				 hash_ip(ipm->m_addr));
 	if (!ch)
 		return -ENOMEM;
 	cache_put(ch, &ip_map_cache);
 	return 0;
 }
 
-int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom)
+int auth_unix_add_addr(struct in6_addr addr, struct auth_domain *dom)
 {
 	struct unix_domain *udom;
 	struct ip_map *ipmp;
@@ -351,7 +375,7 @@
 	return 0;
 }
 
-struct auth_domain *auth_unix_lookup(struct in_addr addr)
+struct auth_domain *auth_unix_lookup6(struct in6_addr addr)
 {
 	struct ip_map *ipm;
 	struct auth_domain *rv;
@@ -375,6 +399,14 @@
 	return rv;
 }
 
+struct auth_domain *auth_unix_lookup(struct in_addr addr)
+{
+	struct in6_addr addr6;
+
+	map_ipaddr_4to6(&addr, &addr6);
+	return auth_unix_lookup6(&addr6);
+}
+
 void svcauth_unix_purge(void)
 {
 	cache_purge(&ip_map_cache);

