Index: linux-2.6.27.y/include/linux/skbuff.h =================================================================== --- linux-2.6.27.y.orig/include/linux/skbuff.h +++ linux-2.6.27.y/include/linux/skbuff.h @@ -330,6 +330,7 @@ struct sk_buff { #endif __u32 mark; +#define skb_tag mark __u16 vlan_tci; Index: linux-2.6.27.y/net/core/skbuff.c =================================================================== --- linux-2.6.27.y.orig/net/core/skbuff.c +++ linux-2.6.27.y/net/core/skbuff.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -197,6 +198,7 @@ struct sk_buff *__alloc_skb(unsigned int skb->data = data; skb_reset_tail_pointer(skb); skb->end = skb->tail + size; + if (!in_interrupt()) skb->skb_tag = nx_current_nid(); else skb->skb_tag = 0; /* make sure we initialize shinfo sequentially */ shinfo = skb_shinfo(skb); atomic_set(&shinfo->dataref, 1); @@ -448,6 +450,7 @@ static void __copy_skb_header(struct sk_ #endif #endif new->vlan_tci = old->vlan_tci; + new->skb_tag = old->skb_tag; skb_copy_secmark(new, old); } @@ -478,6 +481,8 @@ static struct sk_buff *__skb_clone(struc #endif atomic_set(&n->users, 1); + /* Sapan: Cloned skbs aren't owned by anyone. Let the cloner decide who it belongs to. */ + atomic_inc(&(skb_shinfo(skb)->dataref)); skb->cloned = 1; Index: linux-2.6.27.y/net/core/sock.c =================================================================== --- linux-2.6.27.y.orig/net/core/sock.c +++ linux-2.6.27.y/net/core/sock.c @@ -956,6 +956,8 @@ struct sock *sk_alloc(struct net *net, i sk->sk_prot = sk->sk_prot_creator = prot; sock_lock_init(sk); sock_net_set(sk, get_net(net)); + if (!in_interrupt()) + sk->sk_mark = nx_current_nid(); } return sk; Index: linux-2.6.27.y/net/ipv4/af_inet.c =================================================================== --- linux-2.6.27.y.orig/net/ipv4/af_inet.c +++ linux-2.6.27.y/net/ipv4/af_inet.c @@ -181,6 +181,8 @@ static int inet_autobind(struct sock *sk return -EAGAIN; } inet->sport = htons(inet->num); + sk->sk_xid = vx_current_xid(); + if (!in_interrupt()) sk->sk_nid = nx_current_nid(); else sk->sk_nid=0; } release_sock(sk); return 0; Index: linux-2.6.27.y/net/ipv4/netfilter/ipt_LOG.c =================================================================== --- linux-2.6.27.y.orig/net/ipv4/netfilter/ipt_LOG.c +++ linux-2.6.27.y/net/ipv4/netfilter/ipt_LOG.c @@ -45,6 +45,8 @@ static void dump_packet(const struct nf_ else logflags = NF_LOG_MASK; + printk("TAG=%d ", skb->skb_tag); + ih = skb_header_pointer(skb, iphoff, sizeof(_iph), &_iph); if (ih == NULL) { printk("TRUNCATED");