diff -NurpP linux-3.2.2-vs2.3.2.6/include/net/flow.h linux-3.2.2-vs2.3.2.6.2/include/net/flow.h
--- linux-3.2.2-vs2.3.2.6/include/net/flow.h	2012-01-09 16:19:31.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/include/net/flow.h	2012-02-02 16:24:27.000000000 +0100
@@ -16,6 +16,7 @@ struct flowi_common {
 	int	flowic_iif;
 	__u32	flowic_mark;
 	__u8	flowic_tos;
+	nid_t	flowic_nid;
 	__u8	flowic_scope;
 	__u8	flowic_proto;
 	__u8	flowic_flags;
@@ -55,6 +56,7 @@ struct flowi4 {
 #define flowi4_iif		__fl_common.flowic_iif
 #define flowi4_mark		__fl_common.flowic_mark
 #define flowi4_tos		__fl_common.flowic_tos
+#define flowi4_nid		__fl_common.flowic_nid
 #define flowi4_scope		__fl_common.flowic_scope
 #define flowi4_proto		__fl_common.flowic_proto
 #define flowi4_flags		__fl_common.flowic_flags
@@ -72,8 +74,8 @@ struct flowi4 {
 } __attribute__((__aligned__(BITS_PER_LONG/8)));
 
 static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
-				      __u32 mark, __u8 tos, __u8 scope,
-				      __u8 proto, __u8 flags,
+				      __u32 mark, __u8 tos, nid_t nid,
+				      __u8 scope, __u8 proto, __u8 flags,
 				      __be32 daddr, __be32 saddr,
 				      __be16 dport, __be32 sport)
 {
@@ -81,6 +83,7 @@ static inline void flowi4_init_output(st
 	fl4->flowi4_iif = 0;
 	fl4->flowi4_mark = mark;
 	fl4->flowi4_tos = tos;
+	fl4->flowi4_nid = nid;
 	fl4->flowi4_scope = scope;
 	fl4->flowi4_proto = proto;
 	fl4->flowi4_flags = flags;
diff -NurpP linux-3.2.2-vs2.3.2.6/include/net/ip_fib.h linux-3.2.2-vs2.3.2.6.2/include/net/ip_fib.h
--- linux-3.2.2-vs2.3.2.6/include/net/ip_fib.h	2011-07-22 11:18:11.000000000 +0200
+++ linux-3.2.2-vs2.3.2.6.2/include/net/ip_fib.h	2012-02-02 17:15:12.000000000 +0100
@@ -229,7 +229,8 @@ extern struct fib_table *fib_get_table(s
 extern const struct nla_policy rtm_ipv4_policy[];
 extern void		ip_fib_init(void);
 extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
-			       u8 tos, int oif, struct net_device *dev,
+			       u8 tos, nid_t nid, int oif,
+			       struct net_device *dev,
 			       __be32 *spec_dst, u32 *itag);
 extern void fib_select_default(struct fib_result *res);
 
diff -NurpP linux-3.2.2-vs2.3.2.6/include/net/route.h linux-3.2.2-vs2.3.2.6.2/include/net/route.h
--- linux-3.2.2-vs2.3.2.6/include/net/route.h	2011-12-15 01:11:33.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/include/net/route.h	2012-02-02 16:30:58.000000000 +0100
@@ -53,6 +53,7 @@ struct rtable {
 	unsigned		rt_flags;
 	__u16			rt_type;
 	__u8			rt_key_tos;
+	nid_t			rt_key_nid;
 
 	__be32			rt_dst;	/* Path destination	*/
 	__be32			rt_src;	/* Path source		*/
@@ -126,13 +127,14 @@ static inline struct rtable *ip_route_ou
 }
 
 static inline struct rtable *ip_route_output(struct net *net, __be32 daddr,
-					     __be32 saddr, u8 tos, int oif)
+					     __be32 saddr, u8 tos, nid_t nid, int oif)
 {
 	struct flowi4 fl4 = {
 		.flowi4_oif = oif,
 		.daddr = daddr,
 		.saddr = saddr,
 		.flowi4_tos = tos,
+		.flowi4_nid = nid,
 	};
 	return ip_route_output_key(net, &fl4);
 }
@@ -144,7 +146,7 @@ static inline struct rtable *ip_route_ou
 						   __u8 proto, __u8 tos, int oif)
 {
 	flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos,
-			   RT_SCOPE_UNIVERSE, proto,
+			   sk->sk_nid, RT_SCOPE_UNIVERSE, proto,
 			   sk ? inet_sk_flowi_flags(sk) : 0,
 			   daddr, saddr, dport, sport);
 	if (sk)
@@ -154,13 +156,15 @@ static inline struct rtable *ip_route_ou
 
 static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 *fl4,
 						 __be32 daddr, __be32 saddr,
-						 __be32 gre_key, __u8 tos, int oif)
+						 __be32 gre_key, __u8 tos, nid_t nid,
+						 int oif)
 {
 	memset(fl4, 0, sizeof(*fl4));
 	fl4->flowi4_oif = oif;
 	fl4->daddr = daddr;
 	fl4->saddr = saddr;
 	fl4->flowi4_tos = tos;
+	fl4->flowi4_nid = nid;
 	fl4->flowi4_proto = IPPROTO_GRE;
 	fl4->fl4_gre_key = gre_key;
 	return ip_route_output_key(net, fl4);
@@ -252,8 +256,9 @@ static inline void ip_route_connect_init
 	if (can_sleep)
 		flow_flags |= FLOWI_FLAG_CAN_SLEEP;
 
-	flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
-			   protocol, flow_flags, dst, src, dport, sport);
+	flowi4_init_output(fl4, oif, sk->sk_mark, tos, sk->sk_nid, 
+			   RT_SCOPE_UNIVERSE, protocol, flow_flags,
+			   dst, src, dport, sport);
 }
 
 extern struct rtable *ip_v4_find_src(struct net *net, struct nx_info *,
diff -NurpP linux-3.2.2-vs2.3.2.6/net/dccp/ipv4.c linux-3.2.2-vs2.3.2.6.2/net/dccp/ipv4.c
--- linux-3.2.2-vs2.3.2.6/net/dccp/ipv4.c	2011-12-15 01:11:37.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/dccp/ipv4.c	2012-02-02 16:10:35.000000000 +0100
@@ -479,6 +479,7 @@ static struct dst_entry* dccp_v4_route_s
 		.daddr = ip_hdr(skb)->saddr,
 		.saddr = ip_hdr(skb)->daddr,
 		.flowi4_tos = RT_CONN_FLAGS(sk),
+		.flowi4_nid = sk->sk_nid,
 		.flowi4_proto = sk->sk_protocol,
 		.fl4_sport = dccp_hdr(skb)->dccph_dport,
 		.fl4_dport = dccp_hdr(skb)->dccph_sport,
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/arp.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/arp.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/arp.c	2011-12-05 19:33:02.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/arp.c	2012-02-02 17:13:05.000000000 +0100
@@ -432,7 +432,7 @@ static int arp_filter(__be32 sip, __be32
 	/*unsigned long now; */
 	struct net *net = dev_net(dev);
 
-	rt = ip_route_output(net, sip, tip, 0, 0);
+	rt = ip_route_output(net, sip, tip, 0, 0, 0);
 	if (IS_ERR(rt))
 		return 1;
 	if (rt->dst.dev != dev) {
@@ -1030,7 +1030,7 @@ static int arp_req_set(struct net *net, 
 	if (r->arp_flags & ATF_PERM)
 		r->arp_flags |= ATF_COM;
 	if (dev == NULL) {
-		struct rtable *rt = ip_route_output(net, ip, 0, RTO_ONLINK, 0);
+		struct rtable *rt = ip_route_output(net, ip, 0, RTO_ONLINK, 0, 0);
 
 		if (IS_ERR(rt))
 			return PTR_ERR(rt);
@@ -1151,7 +1151,7 @@ static int arp_req_delete(struct net *ne
 
 	ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr;
 	if (dev == NULL) {
-		struct rtable *rt = ip_route_output(net, ip, 0, RTO_ONLINK, 0);
+		struct rtable *rt = ip_route_output(net, ip, 0, RTO_ONLINK, 0, 0);
 		if (IS_ERR(rt))
 			return PTR_ERR(rt);
 		dev = rt->dst.dev;
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/fib_frontend.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/fib_frontend.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/fib_frontend.c	2011-10-24 18:45:34.000000000 +0200
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/fib_frontend.c	2012-02-02 17:16:01.000000000 +0100
@@ -190,8 +190,8 @@ EXPORT_SYMBOL(inet_dev_addr_type);
  * called with rcu_read_lock()
  */
 int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, u8 tos,
-			int oif, struct net_device *dev, __be32 *spec_dst,
-			u32 *itag)
+			nid_t nid, int oif, struct net_device *dev,
+			__be32 *spec_dst, u32 *itag)
 {
 	struct in_device *in_dev;
 	struct flowi4 fl4;
@@ -206,6 +206,7 @@ int fib_validate_source(struct sk_buff *
 	fl4.daddr = src;
 	fl4.saddr = dst;
 	fl4.flowi4_tos = tos;
+	fl4.flowi4_nid = nid;
 	fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
 
 	no_addr = rpf = accept_local = 0;
@@ -877,6 +878,7 @@ static void nl_fib_lookup(struct fib_res
 		.flowi4_mark = frn->fl_mark,
 		.daddr = frn->fl_addr,
 		.flowi4_tos = frn->fl_tos,
+		.flowi4_nid = nx_current_nid(),
 		.flowi4_scope = frn->fl_scope,
 	};
 
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/fib_rules.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/fib_rules.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/fib_rules.c	2011-12-05 19:24:34.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/fib_rules.c	2012-02-02 16:12:15.000000000 +0100
@@ -117,7 +117,8 @@ static int fib4_rule_match(struct fib_ru
 
 	if (r->tos && (r->tos != fl4->flowi4_tos))
 		return 0;
-
+	/* FIXME: check nid? */
+	
 	return 1;
 }
 
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/fib_trie.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/fib_trie.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/fib_trie.c	2011-12-05 19:33:02.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/fib_trie.c	2012-02-02 16:12:51.000000000 +0100
@@ -1372,6 +1372,7 @@ static int check_leaf(struct fib_table *
 
 			if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos)
 				continue;
+			/* FIXME: check nid? */
 			if (fa->fa_info->fib_scope < flp->flowi4_scope)
 				continue;
 			fib_alias_accessed(fa);
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/icmp.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/icmp.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/icmp.c	2011-12-05 19:24:34.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/icmp.c	2012-02-02 17:13:39.000000000 +0100
@@ -358,6 +358,7 @@ static void icmp_reply(struct icmp_bxm *
 	fl4.daddr = daddr;
 	fl4.saddr = rt->rt_spec_dst;
 	fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos);
+	fl4.flowi4_nid = nx_current_nid();
 	fl4.flowi4_proto = IPPROTO_ICMP;
 	security_skb_classify_flow(skb, flowi4_to_flowi(&fl4));
 	rt = ip_route_output_key(net, &fl4);
@@ -388,6 +389,7 @@ static struct rtable *icmp_route_lookup(
 		      param->replyopts.opt.opt.faddr : iph->saddr);
 	fl4->saddr = saddr;
 	fl4->flowi4_tos = RT_TOS(tos);
+	fl4->flowi4_nid = nx_current_nid();
 	fl4->flowi4_proto = IPPROTO_ICMP;
 	fl4->fl4_icmp_type = type;
 	fl4->fl4_icmp_code = code;
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/igmp.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/igmp.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/igmp.c	2012-01-18 02:58:07.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/igmp.c	2012-02-02 17:14:07.000000000 +0100
@@ -1440,7 +1440,7 @@ static struct in_device *ip_mc_find_dev(
 	if (!dev) {
 		struct rtable *rt = ip_route_output(net,
 						    imr->imr_multiaddr.s_addr,
-						    0, 0, 0);
+						    0, 0, 0, 0);
 		if (!IS_ERR(rt)) {
 			dev = rt->dst.dev;
 			ip_rt_put(rt);
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/inet_connection_sock.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/inet_connection_sock.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/inet_connection_sock.c	2011-12-05 19:33:02.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/inet_connection_sock.c	2012-02-02 17:09:10.000000000 +0100
@@ -388,7 +388,7 @@ struct dst_entry *inet_csk_route_req(str
 	struct net *net = sock_net(sk);
 
 	flowi4_init_output(fl4, sk->sk_bound_dev_if, sk->sk_mark,
-			   RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE,
+			   RT_CONN_FLAGS(sk), sk->sk_nid, RT_SCOPE_UNIVERSE,
 			   sk->sk_protocol, inet_sk_flowi_flags(sk),
 			   (opt && opt->opt.srr) ? opt->opt.faddr : ireq->rmt_addr,
 			   ireq->loc_addr, ireq->rmt_port, inet_sk(sk)->inet_sport);
@@ -421,7 +421,7 @@ struct dst_entry *inet_csk_route_child_s
 
 	fl4 = &newinet->cork.fl.u.ip4;
 	flowi4_init_output(fl4, sk->sk_bound_dev_if, sk->sk_mark,
-			   RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE,
+			   RT_CONN_FLAGS(sk), sk->sk_nid, RT_SCOPE_UNIVERSE,
 			   sk->sk_protocol, inet_sk_flowi_flags(sk),
 			   (opt && opt->opt.srr) ? opt->opt.faddr : ireq->rmt_addr,
 			   ireq->loc_addr, ireq->rmt_port, inet_sk(sk)->inet_sport);
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/ip_output.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/ip_output.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/ip_output.c	2011-12-05 19:24:34.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/ip_output.c	2012-02-02 17:07:28.000000000 +0100
@@ -1489,7 +1489,7 @@ void ip_send_reply(struct sock *sk, stru
 	}
 
 	flowi4_init_output(&fl4, arg->bound_dev_if, 0,
-			   RT_TOS(arg->tos),
+			   RT_TOS(arg->tos), sk->sk_nid,
 			   RT_SCOPE_UNIVERSE, sk->sk_protocol,
 			   ip_reply_arg_flowi_flags(arg),
 			   daddr, rt->rt_spec_dst,
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/ipmr.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/ipmr.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/ipmr.c	2011-12-05 19:24:34.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/ipmr.c	2012-02-02 16:15:20.000000000 +0100
@@ -1798,6 +1798,7 @@ static struct mr_table *ipmr_rt_fib_look
 		.daddr = iph->daddr,
 		.saddr = iph->saddr,
 		.flowi4_tos = RT_TOS(iph->tos),
+		.flowi4_nid = rt->rt_key_nid,
 		.flowi4_oif = rt->rt_oif,
 		.flowi4_iif = rt->rt_iif,
 		.flowi4_mark = rt->rt_mark,
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/netfilter.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/netfilter.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/netfilter.c	2011-12-15 01:11:37.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/netfilter.c	2012-02-02 16:59:16.000000000 +0100
@@ -35,6 +35,7 @@ int ip_route_me_harder(struct sk_buff *s
 	fl4.daddr = iph->daddr;
 	fl4.saddr = saddr;
 	fl4.flowi4_tos = RT_TOS(iph->tos);
+	fl4.flowi4_nid = nx_current_nid();
 	fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
 	fl4.flowi4_mark = skb->mark;
 	fl4.flowi4_flags = flags;
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/ping.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/ping.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/ping.c	2011-12-05 19:24:36.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/ping.c	2012-02-02 17:19:00.000000000 +0100
@@ -557,7 +557,7 @@ static int ping_sendmsg(struct kiocb *io
 			saddr = inet->mc_addr;
 	}
 
-	flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos,
+	flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, sk->sk_nid,
 			   RT_SCOPE_UNIVERSE, sk->sk_protocol,
 			   inet_sk_flowi_flags(sk), faddr, saddr, 0, 0);
 
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/raw.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/raw.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/raw.c	2011-12-05 19:33:02.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/raw.c	2012-02-02 17:11:17.000000000 +0100
@@ -568,7 +568,7 @@ static int raw_sendmsg(struct kiocb *ioc
 	}
 
 	flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos,
-			   RT_SCOPE_UNIVERSE,
+			   sk->sk_nid, RT_SCOPE_UNIVERSE,
 			   inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol,
 			   inet_sk_flowi_flags(sk) | FLOWI_FLAG_CAN_SLEEP,
 			   daddr, saddr, 0, 0);
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/route.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/route.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/route.c	2012-01-09 16:19:31.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/route.c	2012-02-02 17:18:27.000000000 +0100
@@ -114,6 +114,8 @@
 
 #define RT_FL_TOS(oldflp4) \
 	((oldflp4)->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK))
+#define RT_FL_NID(oldflp4) \
+	((oldflp4)->flowi4_nid)
 
 #define IP_MAX_MTU	0xFFF0
 
@@ -418,7 +420,7 @@ static int rt_cache_seq_show(struct seq_
 		seq_printf(seq, "%-127s\n",
 			   "Iface\tDestination\tGateway \tFlags\t\tRefCnt\tUse\t"
 			   "Metric\tSource\t\tMTU\tWindow\tIRTT\tTOS\tHHRef\t"
-			   "HHUptod\tSpecDst");
+			   "HHUptod\tSpecDst\tnid");
 	else {
 		struct rtable *r = v;
 		struct neighbour *n;
@@ -430,7 +432,7 @@ static int rt_cache_seq_show(struct seq_
 		rcu_read_unlock();
 
 		seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t"
-			      "%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n",
+			      "%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X\t%04X%n",
 			r->dst.dev ? r->dst.dev->name : "*",
 			(__force u32)r->rt_dst,
 			(__force u32)r->rt_gateway,
@@ -443,7 +445,7 @@ static int rt_cache_seq_show(struct seq_
 			r->rt_key_tos,
 			-1,
 			HHUptod,
-			r->rt_spec_dst, &len);
+			r->rt_spec_dst, r->rt_key_nid, &len);
 
 		seq_printf(seq, "%*s\n", 127 - len, "");
 	}
@@ -740,6 +742,7 @@ static inline int compare_keys(struct rt
 		((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) |
 		(rt1->rt_mark ^ rt2->rt_mark) |
 		(rt1->rt_key_tos ^ rt2->rt_key_tos) |
+		(rt1->rt_key_nid ^ rt2->rt_key_nid) |
 		(rt1->rt_route_iif ^ rt2->rt_route_iif) |
 		(rt1->rt_oif ^ rt2->rt_oif)) == 0;
 }
@@ -1883,6 +1886,7 @@ void ip_rt_get_source(u8 *addr, struct s
 		fl4.daddr = iph->daddr;
 		fl4.saddr = iph->saddr;
 		fl4.flowi4_tos = RT_TOS(iph->tos);
+		fl4.flowi4_nid = nx_current_nid();
 		fl4.flowi4_oif = rt->dst.dev->ifindex;
 		fl4.flowi4_iif = skb->dev->ifindex;
 		fl4.flowi4_mark = skb->mark;
@@ -2043,8 +2047,8 @@ static int ip_route_input_mc(struct sk_b
 			goto e_inval;
 		spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
 	} else {
-		err = fib_validate_source(skb, saddr, 0, tos, 0, dev, &spec_dst,
-					  &itag);
+		err = fib_validate_source(skb, saddr, 0, tos, 0, 0,
+					  dev, &spec_dst, &itag);
 		if (err < 0)
 			goto e_err;
 	}
@@ -2064,6 +2068,7 @@ static int ip_route_input_mc(struct sk_b
 	rth->rt_flags	= RTCF_MULTICAST;
 	rth->rt_type	= RTN_MULTICAST;
 	rth->rt_key_tos	= tos;
+	rth->rt_key_nid	= nx_current_nid();
 	rth->rt_dst	= daddr;
 	rth->rt_src	= saddr;
 	rth->rt_route_iif = dev->ifindex;
@@ -2153,7 +2158,8 @@ static int __mkroute_input(struct sk_buf
 	}
 
 
-	err = fib_validate_source(skb, saddr, daddr, tos, FIB_RES_OIF(*res),
+	err = fib_validate_source(skb, saddr, daddr, tos,
+				  nx_current_nid(), FIB_RES_OIF(*res),
 				  in_dev->dev, &spec_dst, &itag);
 	if (err < 0) {
 		ip_handle_martian_source(in_dev->dev, in_dev, skb, daddr,
@@ -2199,6 +2205,7 @@ static int __mkroute_input(struct sk_buf
 	rth->rt_flags = flags;
 	rth->rt_type = res->type;
 	rth->rt_key_tos	= tos;
+	rth->rt_key_nid	= nx_current_nid();
 	rth->rt_dst	= daddr;
 	rth->rt_src	= saddr;
 	rth->rt_route_iif = in_dev->dev->ifindex;
@@ -2308,6 +2315,7 @@ static int ip_route_input_slow(struct sk
 	fl4.flowi4_iif = dev->ifindex;
 	fl4.flowi4_mark = skb->mark;
 	fl4.flowi4_tos = tos;
+	fl4.flowi4_nid = nx_current_nid();
 	fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
 	fl4.daddr = daddr;
 	fl4.saddr = saddr;
@@ -2325,6 +2333,7 @@ static int ip_route_input_slow(struct sk
 
 	if (res.type == RTN_LOCAL) {
 		err = fib_validate_source(skb, saddr, daddr, tos,
+					  nx_current_nid(),
 					  net->loopback_dev->ifindex,
 					  dev, &spec_dst, &itag);
 		if (err < 0)
@@ -2350,8 +2359,8 @@ brd_input:
 	if (ipv4_is_zeronet(saddr))
 		spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
 	else {
-		err = fib_validate_source(skb, saddr, 0, tos, 0, dev, &spec_dst,
-					  &itag);
+		err = fib_validate_source(skb, saddr, 0, tos, 0, 0,
+				          dev, &spec_dst, &itag);
 		if (err < 0)
 			goto martian_source_keep_err;
 		if (err)
@@ -2379,6 +2388,7 @@ local_input:
 	rth->rt_flags 	= flags|RTCF_LOCAL;
 	rth->rt_type	= res.type;
 	rth->rt_key_tos	= tos;
+	rth->rt_key_nid	= nx_current_nid();
 	rth->rt_dst	= daddr;
 	rth->rt_src	= saddr;
 #ifdef CONFIG_IP_ROUTE_CLASSID
@@ -2467,7 +2477,8 @@ int ip_route_input_common(struct sk_buff
 		if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) |
 		     ((__force u32)rth->rt_key_src ^ (__force u32)saddr) |
 		     (rth->rt_route_iif ^ iif) |
-		     (rth->rt_key_tos ^ tos)) == 0 &&
+		     (rth->rt_key_tos ^ tos) |
+		     (rth->rt_key_nid ^ nx_current_nid())) == 0 &&
 		    rth->rt_mark == skb->mark &&
 		    net_eq(dev_net(rth->dst.dev), net) &&
 		    !rt_is_expired(rth)) {
@@ -2531,6 +2542,7 @@ static struct rtable *__mkroute_output(c
 				       const struct flowi4 *fl4,
 				       __be32 orig_daddr, __be32 orig_saddr,
 				       int orig_oif, __u8 orig_rtos,
+				       nid_t orig_nid,
 				       struct net_device *dev_out,
 				       unsigned int flags)
 {
@@ -2586,6 +2598,7 @@ static struct rtable *__mkroute_output(c
 	rth->rt_flags	= flags;
 	rth->rt_type	= type;
 	rth->rt_key_tos	= orig_rtos;
+	rth->rt_key_nid	= orig_nid;
 	rth->rt_dst	= fl4->daddr;
 	rth->rt_src	= fl4->saddr;
 	rth->rt_route_iif = 0;
@@ -2636,6 +2649,7 @@ static struct rtable *ip_route_output_sl
 {
 	struct net_device *dev_out = NULL;
 	__u8 tos = RT_FL_TOS(fl4);
+	nid_t nid = RT_FL_NID(fl4);
 	unsigned int flags = 0;
 	struct fib_result res;
 	struct rtable *rth;
@@ -2654,6 +2668,7 @@ static struct rtable *ip_route_output_sl
 
 	fl4->flowi4_iif = net->loopback_dev->ifindex;
 	fl4->flowi4_tos = tos & IPTOS_RT_MASK;
+	fl4->flowi4_nid = nid;
 	fl4->flowi4_scope = ((tos & RTO_ONLINK) ?
 			 RT_SCOPE_LINK : RT_SCOPE_UNIVERSE);
 
@@ -2811,7 +2826,7 @@ static struct rtable *ip_route_output_sl
 
 make_route:
 	rth = __mkroute_output(&res, fl4, orig_daddr, orig_saddr, orig_oif,
-			       tos, dev_out, flags);
+			       tos, nid, dev_out, flags);
 	if (!IS_ERR(rth)) {
 		unsigned int hash;
 
@@ -2845,6 +2860,7 @@ struct rtable *__ip_route_output_key(str
 		    rth->rt_mark == flp4->flowi4_mark &&
 		    !((rth->rt_key_tos ^ flp4->flowi4_tos) &
 			    (IPTOS_RT_MASK | RTO_ONLINK)) &&
+		    rth->rt_key_nid == flp4->flowi4_nid  &&
 		    net_eq(dev_net(rth->dst.dev), net) &&
 		    !rt_is_expired(rth)) {
 			ipv4_validate_peer(rth);
@@ -2920,6 +2936,7 @@ struct dst_entry *ipv4_blackhole_route(s
 		rt->rt_key_dst = ort->rt_key_dst;
 		rt->rt_key_src = ort->rt_key_src;
 		rt->rt_key_tos = ort->rt_key_tos;
+		rt->rt_key_nid = ort->rt_key_nid;
 		rt->rt_route_iif = ort->rt_route_iif;
 		rt->rt_iif = ort->rt_iif;
 		rt->rt_oif = ort->rt_oif;
@@ -3136,6 +3153,7 @@ static int inet_rtm_getroute(struct sk_b
 			.daddr = dst,
 			.saddr = src,
 			.flowi4_tos = rtm->rtm_tos,
+			.flowi4_nid = nx_current_nid(),
 			.flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0,
 			.flowi4_mark = mark,
 		};
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/syncookies.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/syncookies.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/syncookies.c	2011-12-05 19:24:36.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/syncookies.c	2012-02-02 17:19:29.000000000 +0100
@@ -350,7 +350,7 @@ struct sock *cookie_v4_check(struct sock
 		struct flowi4 fl4;
 
 		flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk),
-				   RT_SCOPE_UNIVERSE, IPPROTO_TCP,
+				   sk->sk_nid, RT_SCOPE_UNIVERSE, IPPROTO_TCP,
 				   inet_sk_flowi_flags(sk),
 				   (opt && opt->srr) ? opt->faddr : ireq->rmt_addr,
 				   ireq->loc_addr, th->source, th->dest);
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/udp.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/udp.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/udp.c	2011-12-15 01:11:37.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/udp.c	2012-02-02 17:11:52.000000000 +0100
@@ -931,7 +931,7 @@ int udp_sendmsg(struct kiocb *iocb, stru
 
 		fl4 = &fl4_stack;
 		flowi4_init_output(fl4, ipc.oif, sk->sk_mark, tos,
-				   RT_SCOPE_UNIVERSE, sk->sk_protocol,
+				   sk->sk_nid, RT_SCOPE_UNIVERSE, sk->sk_protocol,
 				   inet_sk_flowi_flags(sk)|FLOWI_FLAG_CAN_SLEEP,
 				   faddr, saddr, dport, inet->inet_sport);
 
diff -NurpP linux-3.2.2-vs2.3.2.6/net/ipv4/xfrm4_policy.c linux-3.2.2-vs2.3.2.6.2/net/ipv4/xfrm4_policy.c
--- linux-3.2.2-vs2.3.2.6/net/ipv4/xfrm4_policy.c	2011-12-05 19:24:36.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/ipv4/xfrm4_policy.c	2012-02-02 17:20:55.000000000 +0100
@@ -19,7 +19,7 @@
 static struct xfrm_policy_afinfo xfrm4_policy_afinfo;
 
 static struct dst_entry *__xfrm4_dst_lookup(struct net *net, struct flowi4 *fl4,
-					    int tos,
+					    int tos, 
 					    const xfrm_address_t *saddr,
 					    const xfrm_address_t *daddr)
 {
@@ -28,6 +28,7 @@ static struct dst_entry *__xfrm4_dst_loo
 	memset(fl4, 0, sizeof(*fl4));
 	fl4->daddr = daddr->a4;
 	fl4->flowi4_tos = tos;
+	fl4->flowi4_nid = nx_current_nid();
 	if (saddr)
 		fl4->saddr = saddr->a4;
 
@@ -82,6 +83,7 @@ static int xfrm4_fill_dst(struct xfrm_ds
 	xdst->u.rt.rt_key_dst = fl4->daddr;
 	xdst->u.rt.rt_key_src = fl4->saddr;
 	xdst->u.rt.rt_key_tos = fl4->flowi4_tos;
+	xdst->u.rt.rt_key_nid = fl4->flowi4_nid;
 	xdst->u.rt.rt_route_iif = fl4->flowi4_iif;
 	xdst->u.rt.rt_iif = fl4->flowi4_iif;
 	xdst->u.rt.rt_oif = fl4->flowi4_oif;
@@ -188,6 +190,7 @@ _decode_session4(struct sk_buff *skb, st
 	fl4->daddr = reverse ? iph->saddr : iph->daddr;
 	fl4->saddr = reverse ? iph->daddr : iph->saddr;
 	fl4->flowi4_tos = iph->tos;
+	fl4->flowi4_nid = nx_current_nid();
 }
 
 static inline int xfrm4_garbage_collect(struct dst_ops *ops)
diff -NurpP linux-3.2.2-vs2.3.2.6/net/netfilter/ipvs/ip_vs_xmit.c linux-3.2.2-vs2.3.2.6.2/net/netfilter/ipvs/ip_vs_xmit.c
--- linux-3.2.2-vs2.3.2.6/net/netfilter/ipvs/ip_vs_xmit.c	2011-12-05 19:33:02.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/netfilter/ipvs/ip_vs_xmit.c	2012-02-02 17:02:50.000000000 +0100
@@ -103,6 +103,7 @@ __ip_vs_get_out_rt(struct sk_buff *skb, 
 			memset(&fl4, 0, sizeof(fl4));
 			fl4.daddr = dest->addr.ip;
 			fl4.flowi4_tos = rtos;
+			fl4.flowi4_nid = nx_current_nid();
 			rt = ip_route_output_key(net, &fl4);
 			if (IS_ERR(rt)) {
 				spin_unlock(&dest->dst_lock);
@@ -127,6 +128,7 @@ __ip_vs_get_out_rt(struct sk_buff *skb, 
 		memset(&fl4, 0, sizeof(fl4));
 		fl4.daddr = daddr;
 		fl4.flowi4_tos = rtos;
+		fl4.flowi4_nid = nx_current_nid();
 		rt = ip_route_output_key(net, &fl4);
 		if (IS_ERR(rt)) {
 			IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
@@ -186,6 +188,7 @@ __ip_vs_reroute_locally(struct sk_buff *
 			.daddr = iph->daddr,
 			.saddr = iph->saddr,
 			.flowi4_tos = RT_TOS(iph->tos),
+			.flowi4_nid = nx_current_nid(),
 			.flowi4_mark = skb->mark,
 		};
 
diff -NurpP linux-3.2.2-vs2.3.2.6/net/netfilter/xt_TEE.c linux-3.2.2-vs2.3.2.6.2/net/netfilter/xt_TEE.c
--- linux-3.2.2-vs2.3.2.6/net/netfilter/xt_TEE.c	2011-05-22 16:18:01.000000000 +0200
+++ linux-3.2.2-vs2.3.2.6.2/net/netfilter/xt_TEE.c	2012-02-02 17:03:02.000000000 +0100
@@ -72,6 +72,7 @@ tee_tg_route4(struct sk_buff *skb, const
 	}
 	fl4.daddr = info->gw.ip;
 	fl4.flowi4_tos = RT_TOS(iph->tos);
+	fl4.flowi4_nid = nx_current_nid();
 	fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
 	rt = ip_route_output_key(net, &fl4);
 	if (IS_ERR(rt))
diff -NurpP linux-3.2.2-vs2.3.2.6/net/sctp/protocol.c linux-3.2.2-vs2.3.2.6.2/net/sctp/protocol.c
--- linux-3.2.2-vs2.3.2.6/net/sctp/protocol.c	2012-01-09 16:19:31.000000000 +0100
+++ linux-3.2.2-vs2.3.2.6.2/net/sctp/protocol.c	2012-02-02 16:23:29.000000000 +0100
@@ -473,6 +473,7 @@ static void sctp_v4_get_dst(struct sctp_
 	fl4->flowi4_proto = IPPROTO_SCTP;
 	if (asoc) {
 		fl4->flowi4_tos = RT_CONN_FLAGS(asoc->base.sk);
+		fl4->flowi4_nid = asoc->base.sk->sn_nid;
 		fl4->flowi4_oif = asoc->base.sk->sk_bound_dev_if;
 		fl4->fl4_sport = htons(asoc->base.bind_addr.port);
 	}
