--- linux-2.6.11-rc2-vs1.9.4-rc3/net/core/sock.c	2005-01-22 16:01:43 +0100
+++ linux-2.6.11-rc2-vs1.9.4-rc3-ng8.13/net/core/sock.c	2005-01-23 21:50:37 +0100
@@ -668,8 +668,13 @@ void sk_free(struct sock *sk)
 		       __FUNCTION__, atomic_read(&sk->sk_omem_alloc));
 
 	security_sk_free(sk);
-	BUG_ON(sk->sk_vx_info);
+	// BUG_ON(sk->sk_vx_info);
+	clr_vx_info(&sk->sk_vx_info);
+	sk->sk_xid = -1;
-	BUG_ON(sk->sk_nx_info);
+	// BUG_ON(sk->sk_nx_info);
+	clr_nx_info(&sk->sk_nx_info);
+	sk->sk_nid = -1;
+
 	kmem_cache_free(sk->sk_slab, sk);
 	module_put(owner);
 }
@@ -1218,10 +1220,10 @@ void sock_init_data(struct socket *sock,
 	sk->sk_stamp.tv_sec     = -1L;
 	sk->sk_stamp.tv_usec    = -1L;
 
-	sk->sk_vx_info		=	NULL;
-	sk->sk_xid		=	0;
+	set_vx_info(&sk->sk_vx_info, current->vx_info);
+	sk->sk_xid = vx_current_xid();
-	sk->sk_nx_info		=	NULL;
-	sk->sk_nid		=	0;
+	set_nx_info(&sk->sk_nx_info, current->nx_info);
+	sk->sk_nid = vx_current_nid();
 
 	atomic_set(&sk->sk_refcnt, 1);
 }
--- linux-2.6.11-rc2-vs1.9.4-rc3/net/ipv4/af_inet.c	2005-01-22 16:01:43 +0100
+++ linux-2.6.11-rc2-vs1.9.4-rc3-ng8.13/net/ipv4/af_inet.c	2005-01-23 21:50:37 +0100
@@ -156,10 +156,6 @@ void inet_sock_destruct(struct sock *sk)
 		kfree(inet->opt);
 
 	vx_sock_dec(sk);
-	clr_vx_info(&sk->sk_vx_info);
-	sk->sk_xid = -1;
-	clr_nx_info(&sk->sk_nx_info);
-	sk->sk_nid = -1;
 
 	dst_release(sk->sk_dst_cache);
 #ifdef INET_REFCNT_DEBUG
@@ -327,11 +323,7 @@ override:
 	sk->sk_protocol	   = protocol;
 	sk->sk_backlog_rcv = sk->sk_prot->backlog_rcv;
 
-	set_vx_info(&sk->sk_vx_info, current->vx_info);
-	sk->sk_xid = vx_current_xid();
 	vx_sock_inc(sk);
-	set_nx_info(&sk->sk_nx_info, current->nx_info);
-	sk->sk_nid = nx_current_nid();
 
 	inet->uc_ttl	= -1;
 	inet->mc_loop	= 1;
@@ -395,10 +387,6 @@ int inet_release(struct socket *sock)
 			timeout = sk->sk_lingertime;
 		sock->sk = NULL;
 		vx_sock_dec(sk);
-		clr_vx_info(&sk->sk_vx_info);
-		sk->sk_xid = -1;
-		clr_nx_info(&sk->sk_nx_info);
-		sk->sk_nid = -1;
 		sk->sk_prot->close(sk, timeout);
 	}
 	return 0;
--- linux-2.6.11-rc2-vs1.9.4-rc3/net/ipv4/tcp_ipv4.c	2005-01-22 16:01:43 +0100
+++ linux-2.6.11-rc2-vs1.9.4-rc3-ng8.13/net/ipv4/tcp_ipv4.c	2005-01-31 13:46:56 +0100
@@ -431,64 +434,88 @@ static inline int tcp_addr_match (
 	sk_for_each(sk, node, head) {
 		struct inet_sock *inet = inet_sk(sk);
 
+		if (!vx_sk_check(sk, nfxid))
+			continue;
 		if (inet->num == hnum && !ipv6_only_sock(sk)) {
 			__u32 rcv_saddr = inet->rcv_saddr;
 
@@ -431,64 +434,88 @@ static inline int tcp_addr_match (
 	if (!hlist_empty(head)) {
 		struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
 
+		if (!vx_sk_check(sk, nfxid))
+			goto no_sherry;
 		if (inet->num == hnum && !sk->sk_node.next &&
		    (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
 		    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
@@ -431,64 +434,88 @@ static inline int tcp_addr_match (
		    tcp_addr_match(sk->sk_nx_info, daddr, inet->rcv_saddr) &&
 		    !sk->sk_bound_dev_if)
 			goto sherry_cache;
-		sk = __tcp_v4_lookup_listener(head, daddr, hnum, dif);
+	no_sherry:
+		sk = __tcp_v4_lookup_listener(head, daddr, hnum, dif, nfxid);
 	}
 	if (sk) {
 sherry_cache:
--- linux-2.6.11-rc2-vs1.9.4-rc3/net/netlink/af_netlink.c	2005-01-22 16:01:43 +0100
+++ linux-2.6.11-rc2-vs1.9.4-rc3-ng8.13/net/netlink/af_netlink.c	2005-01-23 21:50:37 +0100
@@ -360,11 +360,7 @@ static int netlink_create(struct socket 
 	init_waitqueue_head(&nlk->wait);
 	sk->sk_destruct = netlink_sock_destruct;
 
-	set_vx_info(&sk->sk_vx_info, current->vx_info);
-	sk->sk_xid = vx_current_xid();
 	vx_sock_inc(sk);
-	set_nx_info(&sk->sk_nx_info, current->nx_info);
-	sk->sk_nid = nx_current_nid();
 
 	sk->sk_protocol = protocol;
 	return 0;
@@ -408,10 +404,6 @@ static int netlink_release(struct socket
 	}	
 	
 	vx_sock_dec(sk);
-	clr_vx_info(&sk->sk_vx_info);
-	sk->sk_xid = -1;
-	clr_nx_info(&sk->sk_nx_info);
-	sk->sk_nid = -1;
 
 	sock_put(sk);
 	return 0;
--- linux-2.6.11-rc2-vs1.9.4-rc3/net/unix/af_unix.c	2005-01-22 16:01:43 +0100
+++ linux-2.6.11-rc2-vs1.9.4-rc3-ng8.13/net/unix/af_unix.c	2005-01-23 21:50:37 +0100
@@ -556,10 +556,7 @@ static struct sock * unix_create1(struct
 	sock_init_data(sock,sk);
 	sk_set_owner(sk, THIS_MODULE);
 
-	set_vx_info(&sk->sk_vx_info, current->vx_info);
-	sk->sk_xid = vx_current_xid();
 	vx_sock_inc(sk);
-	set_nx_info(&sk->sk_nx_info, current->nx_info);
 
 	sk->sk_write_space	= unix_write_space;
 	sk->sk_max_ack_backlog	= sysctl_unix_max_dgram_qlen;
