diff -NurpP linux-3.2.5-vs2.3.2.6/drivers/infiniband/Kconfig linux-3.2.5-vs2.3.x-ipv6/drivers/infiniband/Kconfig
--- linux-3.2.5-vs2.3.2.6/drivers/infiniband/Kconfig	2011-07-22 11:17:45.000000000 +0200
+++ linux-3.2.5-vs2.3.x-ipv6/drivers/infiniband/Kconfig	2012-02-14 11:27:53.000000000 +0100
@@ -39,7 +39,7 @@ config INFINIBAND_USER_MEM
 config INFINIBAND_ADDR_TRANS
 	bool
 	depends on INET
-	depends on !(INFINIBAND = y && IPV6 = m)
+	depends on !(INFINIBAND = y && IPV6 = y)
 	default y
 
 source "drivers/infiniband/hw/mthca/Kconfig"
diff -NurpP linux-3.2.5-vs2.3.2.6/include/linux/vs_inet.h linux-3.2.5-vs2.3.x-ipv6/include/linux/vs_inet.h
--- linux-3.2.5-vs2.3.2.6/include/linux/vs_inet.h	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/include/linux/vs_inet.h	2012-02-14 11:01:15.000000000 +0100
@@ -297,7 +297,7 @@ static inline int v4_inet_addr_match (
 	return 0;
 }
 
-static inline __be32 nx_map_sock_lback(struct nx_info *nxi, __be32 addr)
+static inline __be32 nx_map_v4_lback(struct nx_info *nxi, __be32 addr)
 {
 	if (nx_info_flags(nxi, NXF_HIDE_LBACK, 0) &&
 		(addr == nxi->v4_lback.s_addr))
diff -NurpP linux-3.2.5-vs2.3.2.6/include/linux/vs_inet6.h linux-3.2.5-vs2.3.x-ipv6/include/linux/vs_inet6.h
--- linux-3.2.5-vs2.3.2.6/include/linux/vs_inet6.h	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/include/linux/vs_inet6.h	2012-02-14 11:29:55.000000000 +0100
@@ -199,6 +199,17 @@ void v6_set_sock_addr(struct inet_sock *
 	// inet->inet_saddr = nsa->baddr;
 }
 
+
+
+static inline const struct in6_addr *nx_map_v6_lback(
+	struct nx_info *nxi, const struct in6_addr *addr)
+{
+	if (nx_info_flags(nxi, NXF_HIDE_LBACK, 0) &&
+		ipv6_addr_equal(addr, &nxi->v6_lback))
+		return &in6addr_loopback;
+	return addr;
+}
+
 static inline
 int nx_info_has_v6(struct nx_info *nxi)
 {
@@ -230,6 +241,12 @@ int v6_ifa_in_nx_info(struct in_ifaddr *
 	return 1;
 }
 
+static inline const struct in6_addr *nx_map_v6_lback(
+	struct nx_info *nxi, const struct in6_addr *addr)
+{
+	return addr;
+}
+
 static inline
 int nx_info_has_v6(struct nx_info *nxi)
 {
diff -NurpP linux-3.2.5-vs2.3.2.6/include/linux/vserver/network.h linux-3.2.5-vs2.3.x-ipv6/include/linux/vserver/network.h
--- linux-3.2.5-vs2.3.2.6/include/linux/vserver/network.h	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/include/linux/vserver/network.h	2012-02-14 10:19:54.000000000 +0100
@@ -109,11 +109,12 @@ struct nx_info {
 	uint64_t nx_flags;		/* network flag word */
 	uint64_t nx_ncaps;		/* network capabilities */
 
-	struct in_addr v4_lback;	/* Loopback address */
+	struct in_addr v4_lback;	/* IPv4 Loopback address */
 	struct in_addr v4_bcast;	/* Broadcast address */
-	struct nx_addr_v4 v4;		/* First/Single ipv4 address */
+	struct nx_addr_v4 v4;		/* First/Single IPv4 address */
 #ifdef	CONFIG_IPV6
-	struct nx_addr_v6 v6;		/* First/Single ipv6 address */
+	struct in6_addr v6_lback;	/* IPv6 Loopback address */
+	struct nx_addr_v6 v6;		/* First/Single IPv6 address */
 #endif
 	char nx_name[65];		/* network context name */
 };
diff -NurpP linux-3.2.5-vs2.3.2.6/kernel/vserver/network.c linux-3.2.5-vs2.3.x-ipv6/kernel/vserver/network.c
--- linux-3.2.5-vs2.3.2.6/kernel/vserver/network.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/kernel/vserver/network.c	2012-02-14 11:48:23.000000000 +0100
@@ -18,6 +18,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/rcupdate.h>
+#include <net/ipv6.h>
 
 #include <linux/vs_network.h>
 #include <linux/vs_pid.h>
@@ -139,7 +140,9 @@ static struct nx_info *__alloc_nx_info(n
 
 	new->v4_lback.s_addr = htonl(INADDR_LOOPBACK);
 	new->v4_bcast.s_addr = htonl(INADDR_BROADCAST);
-
+#ifdef CONFIG_IPV6
+	new->v6_lback = in6addr_loopback;
+#endif
 	vxdprintk(VXD_CBIT(nid, 0),
 		"alloc_nx_info(%d) = %p", nid, new);
 	atomic_inc(&nx_global_ctotal);
@@ -191,7 +194,7 @@ void free_nx_info(struct nx_info *nxi)
 }
 
 
-void __nx_set_lback(struct nx_info *nxi)
+void __nx_set_v4_lback(struct nx_info *nxi)
 {
 	int nid = nxi->nx_id;
 	__be32 lback = htonl(INADDR_LOOPBACK ^ ((nid & 0xFFFF) << 8));
@@ -199,8 +202,17 @@ void __nx_set_lback(struct nx_info *nxi)
 	nxi->v4_lback.s_addr = lback;
 }
 
-extern int __nx_inet_add_lback(__be32 addr);
-extern int __nx_inet_del_lback(__be32 addr);
+#ifdef CONFIG_IPV6
+void __nx_set_v6_lback(struct nx_info *nxi)
+{
+	int nid = nxi->nx_id;
+	__be32 lback = htonl(INADDR_LOOPBACK ^ ((nid & 0xFFFF) << 8));
+
+	ipv6_addr_set_v4mapped(lback, &nxi->v6_lback);
+}
+#else	/* !CONFIG_IPV6 */
+#define	__nx_set_v6_lback(n)	do { } while(0)
+#endif	/* CONFIG_IPV6 */
 
 
 /*	hash table for nx_info hash */
@@ -322,7 +334,8 @@ static struct nx_info *__create_nx_info(
 	vxdprintk(VXD_CBIT(nid, 0),
 		"create_nx_info(%d) = %p (new)", id, new);
 	claim_nx_info(new, NULL);
-	__nx_set_lback(new);
+	__nx_set_v4_lback(new);
+	__nx_set_v6_lback(new);
 	__hash_nx_info(get_nx_info(new));
 	nxi = new, new = NULL;
 
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv4/af_inet.c linux-3.2.5-vs2.3.x-ipv6/net/ipv4/af_inet.c
--- linux-3.2.5-vs2.3.2.6/net/ipv4/af_inet.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv4/af_inet.c	2012-02-14 11:01:15.000000000 +0100
@@ -726,12 +726,12 @@ int inet_getname(struct socket *sock, st
 			return -ENOTCONN;
 		sin->sin_port = inet->inet_dport;
 		sin->sin_addr.s_addr =
-			nx_map_sock_lback(sk->sk_nx_info, inet->inet_daddr);
+			nx_map_v4_lback(sk->sk_nx_info, inet->inet_daddr);
 	} else {
 		__be32 addr = inet->inet_rcv_saddr;
 		if (!addr)
 			addr = inet->inet_saddr;
-		addr = nx_map_sock_lback(sk->sk_nx_info, addr);
+		addr = nx_map_v4_lback(sk->sk_nx_info, addr);
 		sin->sin_port = inet->inet_sport;
 		sin->sin_addr.s_addr = addr;
 	}
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv4/inet_diag.c linux-3.2.5-vs2.3.x-ipv6/net/ipv4/inet_diag.c
--- linux-3.2.5-vs2.3.2.6/net/ipv4/inet_diag.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv4/inet_diag.c	2012-02-14 11:01:15.000000000 +0100
@@ -121,9 +121,9 @@ static int inet_csk_diag_fill(struct soc
 
 	r->id.idiag_sport = inet->inet_sport;
 	r->id.idiag_dport = inet->inet_dport;
-	r->id.idiag_src[0] = nx_map_sock_lback(sk->sk_nx_info,
+	r->id.idiag_src[0] = nx_map_v4_lback(sk->sk_nx_info,
 		inet->inet_rcv_saddr);
-	r->id.idiag_dst[0] = nx_map_sock_lback(sk->sk_nx_info,
+	r->id.idiag_dst[0] = nx_map_v4_lback(sk->sk_nx_info,
 		inet->inet_daddr);
 
 	/* IPv6 dual-stack sockets use inet->tos for IPv4 connections,
@@ -218,8 +218,8 @@ static int inet_twsk_diag_fill(struct in
 	r->id.idiag_cookie[1] = (u32)(((unsigned long)tw >> 31) >> 1);
 	r->id.idiag_sport     = tw->tw_sport;
 	r->id.idiag_dport     = tw->tw_dport;
-	r->id.idiag_src[0]    = nx_map_sock_lback(tw->tw_nx_info, tw->tw_rcv_saddr);
-	r->id.idiag_dst[0]    = nx_map_sock_lback(tw->tw_nx_info, tw->tw_daddr);
+	r->id.idiag_src[0]    = nx_map_v4_lback(tw->tw_nx_info, tw->tw_rcv_saddr);
+	r->id.idiag_dst[0]    = nx_map_v4_lback(tw->tw_nx_info, tw->tw_daddr);
 	r->idiag_state	      = tw->tw_substate;
 	r->idiag_timer	      = 3;
 	r->idiag_expires      = DIV_ROUND_UP(tmo * 1000, HZ);
@@ -605,8 +605,8 @@ static int inet_diag_fill_req(struct sk_
 
 	r->id.idiag_sport = inet->inet_sport;
 	r->id.idiag_dport = ireq->rmt_port;
-	r->id.idiag_src[0] = nx_map_sock_lback(sk->sk_nx_info, ireq->loc_addr);
-	r->id.idiag_dst[0] = nx_map_sock_lback(sk->sk_nx_info, ireq->rmt_addr);
+	r->id.idiag_src[0] = nx_map_v4_lback(sk->sk_nx_info, ireq->loc_addr);
+	r->id.idiag_dst[0] = nx_map_v4_lback(sk->sk_nx_info, ireq->rmt_addr);
 	r->idiag_expires = jiffies_to_msecs(tmo);
 	r->idiag_rqueue = 0;
 	r->idiag_wqueue = 0;
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv4/raw.c linux-3.2.5-vs2.3.x-ipv6/net/ipv4/raw.c
--- linux-3.2.5-vs2.3.2.6/net/ipv4/raw.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv4/raw.c	2012-02-14 11:01:15.000000000 +0100
@@ -730,7 +730,7 @@ static int raw_recvmsg(struct kiocb *ioc
 	if (sin) {
 		sin->sin_family = AF_INET;
 		sin->sin_addr.s_addr =
-			nx_map_sock_lback(sk->sk_nx_info, ip_hdr(skb)->saddr);
+			nx_map_v4_lback(sk->sk_nx_info, ip_hdr(skb)->saddr);
 		sin->sin_port = 0;
 		memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
 	}
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv4/tcp_ipv4.c linux-3.2.5-vs2.3.x-ipv6/net/ipv4/tcp_ipv4.c
--- linux-3.2.5-vs2.3.2.6/net/ipv4/tcp_ipv4.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv4/tcp_ipv4.c	2012-02-14 11:01:15.000000000 +0100
@@ -2418,9 +2418,9 @@ static void get_openreq4(const struct so
 	seq_printf(f, "%4d: %08X:%04X %08X:%04X"
 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %pK%n",
 		i,
-		nx_map_sock_lback(current_nx_info(), ireq->loc_addr),
+		nx_map_v4_lback(current_nx_info(), ireq->loc_addr),
 		ntohs(inet_sk(sk)->inet_sport),
-		nx_map_sock_lback(current_nx_info(), ireq->rmt_addr),
+		nx_map_v4_lback(current_nx_info(), ireq->rmt_addr),
 		ntohs(ireq->rmt_port),
 		TCP_SYN_RECV,
 		0, 0, /* could print option size, but that is af dependent. */
@@ -2442,8 +2442,8 @@ static void get_tcp4_sock(struct sock *s
 	const struct tcp_sock *tp = tcp_sk(sk);
 	const struct inet_connection_sock *icsk = inet_csk(sk);
 	const struct inet_sock *inet = inet_sk(sk);
-	__be32 dest = nx_map_sock_lback(current_nx_info(), inet->inet_daddr);
-	__be32 src = nx_map_sock_lback(current_nx_info(), inet->inet_rcv_saddr);
+	__be32 dest = nx_map_v4_lback(current_nx_info(), inet->inet_daddr);
+	__be32 src = nx_map_v4_lback(current_nx_info(), inet->inet_rcv_saddr);
 	__u16 destp = ntohs(inet->inet_dport);
 	__u16 srcp = ntohs(inet->inet_sport);
 	int rx_queue;
@@ -2500,8 +2500,8 @@ static void get_timewait4_sock(const str
 	if (ttd < 0)
 		ttd = 0;
 
-	dest  = nx_map_sock_lback(current_nx_info(), tw->tw_daddr);
-	src   = nx_map_sock_lback(current_nx_info(), tw->tw_rcv_saddr);
+	dest  = nx_map_v4_lback(current_nx_info(), tw->tw_daddr);
+	src   = nx_map_v4_lback(current_nx_info(), tw->tw_rcv_saddr);
 	destp = ntohs(tw->tw_dport);
 	srcp  = ntohs(tw->tw_sport);
 
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv4/udp.c linux-3.2.5-vs2.3.x-ipv6/net/ipv4/udp.c
--- linux-3.2.5-vs2.3.2.6/net/ipv4/udp.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv4/udp.c	2012-02-14 11:01:15.000000000 +0100
@@ -1243,7 +1243,7 @@ try_again:
 	if (sin) {
 		sin->sin_family = AF_INET;
 		sin->sin_port = udp_hdr(skb)->source;
-		sin->sin_addr.s_addr = nx_map_sock_lback(
+		sin->sin_addr.s_addr = nx_map_v4_lback(
 			skb->sk->sk_nx_info, ip_hdr(skb)->saddr);
 		memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
 	}
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv6/raw.c linux-3.2.5-vs2.3.x-ipv6/net/ipv6/raw.c
--- linux-3.2.5-vs2.3.2.6/net/ipv6/raw.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv6/raw.c	2012-02-14 12:08:36.000000000 +0100
@@ -1235,8 +1235,8 @@ static void raw6_sock_seq_show(struct se
 	const struct in6_addr *dest, *src;
 	__u16 destp, srcp;
 
-	dest  = &np->daddr;
-	src   = &np->rcv_saddr;
+	dest  = nx_map_v6_lback(sp->sk_nx_info, &np->daddr);
+	src   = nx_map_v6_lback(sp->sk_nx_info, &np->rcv_saddr);
 	destp = 0;
 	srcp  = inet_sk(sp)->inet_num;
 	seq_printf(seq,
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv6/tcp_ipv6.c linux-3.2.5-vs2.3.x-ipv6/net/ipv6/tcp_ipv6.c
--- linux-3.2.5-vs2.3.2.6/net/ipv6/tcp_ipv6.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv6/tcp_ipv6.c	2012-02-14 12:16:39.000000000 +0100
@@ -144,6 +144,9 @@ static int tcp_v6_connect(struct sock *s
 	if (usin->sin6_family != AF_INET6)
 		return -EAFNOSUPPORT;
 
+	/* FIXME: remap usin for lback */
+
+
 	memset(&fl6, 0, sizeof(fl6));
 
 	if (np->sndflow) {
@@ -163,15 +166,8 @@ static int tcp_v6_connect(struct sock *s
 	 *	connect() to INADDR_ANY means loopback (BSD'ism).
 	 */
 
-	if(ipv6_addr_any(&usin->sin6_addr)) {
-		struct nx_info *nxi =  sk->sk_nx_info;
-
-		if (nxi && nx_info_has_v6(nxi))
-			/* FIXME: remap lback? */
-			usin->sin6_addr = nxi->v6.ip;
-		else
-			usin->sin6_addr.s6_addr[15] = 0x1;
-	}
+	if(ipv6_addr_any(&usin->sin6_addr))
+		usin->sin6_addr.s6_addr[15] = 0x1;
 
 	addr_type = ipv6_addr_type(&usin->sin6_addr);
 
@@ -2027,8 +2023,10 @@ static void get_openreq6(struct seq_file
 			 const struct sock *sk, struct request_sock *req, int i, int uid)
 {
 	int ttd = req->expires - jiffies;
-	const struct in6_addr *src = &inet6_rsk(req)->loc_addr;
-	const struct in6_addr *dest = &inet6_rsk(req)->rmt_addr;
+	const struct in6_addr *src = nx_map_v6_lback(sk->sk_nx_info,
+						     &inet6_rsk(req)->loc_addr);
+	const struct in6_addr *dest = nx_map_v6_lback(sk->sk_nx_info,
+						      &inet6_rsk(req)->rmt_addr);
 
 	if (ttd < 0)
 		ttd = 0;
@@ -2065,8 +2063,8 @@ static void get_tcp6_sock(struct seq_fil
 	const struct inet_connection_sock *icsk = inet_csk(sp);
 	const struct ipv6_pinfo *np = inet6_sk(sp);
 
-	dest  = &np->daddr;
-	src   = &np->rcv_saddr;
+	dest  = nx_map_v6_lback(sp->sk_nx_info, &np->daddr);
+	src   = nx_map_v6_lback(sp->sk_nx_info, &np->rcv_saddr);
 	destp = ntohs(inet->inet_dport);
 	srcp  = ntohs(inet->inet_sport);
 
@@ -2121,8 +2119,8 @@ static void get_timewait6_sock(struct se
 	if (ttd < 0)
 		ttd = 0;
 
-	dest = &tw6->tw_v6_daddr;
-	src  = &tw6->tw_v6_rcv_saddr;
+	dest  = nx_map_v6_lback(tw->tw_nx_info, &tw6->tw_v6_daddr);
+	src   = nx_map_v6_lback(tw->tw_nx_info, &tw6->tw_v6_rcv_saddr);
 	destp = ntohs(tw->tw_dport);
 	srcp  = ntohs(tw->tw_sport);
 
diff -NurpP linux-3.2.5-vs2.3.2.6/net/ipv6/udp.c linux-3.2.5-vs2.3.x-ipv6/net/ipv6/udp.c
--- linux-3.2.5-vs2.3.2.6/net/ipv6/udp.c	2012-02-15 02:45:31.000000000 +0100
+++ linux-3.2.5-vs2.3.x-ipv6/net/ipv6/udp.c	2012-02-14 11:07:50.000000000 +0100
@@ -1419,8 +1419,8 @@ static void udp6_sock_seq_show(struct se
 	const struct in6_addr *dest, *src;
 	__u16 destp, srcp;
 
-	dest  = &np->daddr;
-	src   = &np->rcv_saddr;
+	dest  = nx_map_v6_lback(sp->sk_nx_info, &np->daddr);
+	src   = nx_map_v6_lback(sp->sk_nx_info, &np->rcv_saddr);
 	destp = ntohs(inet->inet_dport);
 	srcp  = ntohs(inet->inet_sport);
 	seq_printf(seq,
