* (Cleanup) Split up the VNET+ patch into its 5 component patches
[linux-2.6.git] / linux-2.6-521-packet-tagging.patch
diff --git a/linux-2.6-521-packet-tagging.patch b/linux-2.6-521-packet-tagging.patch
new file mode 100644 (file)
index 0000000..5fcc1cf
--- /dev/null
@@ -0,0 +1,72 @@
+diff -Nurb linux-2.6.22-510/include/linux/skbuff.h linux-2.6.22-520/include/linux/skbuff.h
+--- linux-2.6.22-510/include/linux/skbuff.h    2007-07-08 19:32:17.000000000 -0400
++++ linux-2.6.22-520/include/linux/skbuff.h    2008-06-06 17:07:56.000000000 -0400
+@@ -302,6 +302,7 @@
+ #endif
+       __u32                   mark;
++#define skb_tag                       mark
+       sk_buff_data_t          transport_header;
+       sk_buff_data_t          network_header;
+diff -Nurb linux-2.6.22-510/net/core/skbuff.c linux-2.6.22-520/net/core/skbuff.c
+--- linux-2.6.22-510/net/core/skbuff.c 2007-07-08 19:32:17.000000000 -0400
++++ linux-2.6.22-520/net/core/skbuff.c 2008-06-06 17:07:56.000000000 -0400
+@@ -56,6 +56,7 @@
+ #include <linux/rtnetlink.h>
+ #include <linux/init.h>
+ #include <linux/scatterlist.h>
++#include <linux/vs_network.h>
+ #include <net/protocol.h>
+ #include <net/dst.h>
+@@ -174,6 +175,7 @@
+       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);
+@@ -443,6 +445,8 @@
+       C(tail);
+       C(end);
++      /* 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;
+@@ -492,6 +496,7 @@
+       new->tc_index   = old->tc_index;
+ #endif
+       skb_copy_secmark(new, old);
++      new->skb_tag = old->skb_tag;
+       atomic_set(&new->users, 1);
+       skb_shinfo(new)->gso_size = skb_shinfo(old)->gso_size;
+       skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
+diff -Nurb linux-2.6.22-510/net/ipv4/af_inet.c linux-2.6.22-520/net/ipv4/af_inet.c
+--- linux-2.6.22-510/net/ipv4/af_inet.c        2008-06-06 17:07:48.000000000 -0400
++++ linux-2.6.22-520/net/ipv4/af_inet.c        2008-06-06 17:07:56.000000000 -0400
+@@ -178,6 +178,8 @@
+                       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;
+diff -Nurb linux-2.6.22-510/net/ipv4/netfilter/ipt_LOG.c linux-2.6.22-520/net/ipv4/netfilter/ipt_LOG.c
+--- linux-2.6.22-510/net/ipv4/netfilter/ipt_LOG.c      2008-06-06 17:07:43.000000000 -0400
++++ linux-2.6.22-520/net/ipv4/netfilter/ipt_LOG.c      2008-06-06 17:07:56.000000000 -0400
+@@ -49,6 +49,8 @@
+       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");
+