revert back to .14
[linux-2.6.git] / linux-2.6-521-packet-tagging.patch
1 diff -Nurb linux-2.6.27-510/include/linux/skbuff.h linux-2.6.27-521/include/linux/skbuff.h
2 --- linux-2.6.27-510/include/linux/skbuff.h     2008-10-09 18:13:53.000000000 -0400
3 +++ linux-2.6.27-521/include/linux/skbuff.h     2009-07-23 10:51:52.000000000 -0400
4 @@ -330,6 +330,7 @@
5  #endif
6  
7         __u32                   mark;
8 +#define skb_tag                        mark
9  
10         __u16                   vlan_tci;
11  
12 diff -Nurb linux-2.6.27-510/net/core/skbuff.c linux-2.6.27-521/net/core/skbuff.c
13 --- linux-2.6.27-510/net/core/skbuff.c  2008-10-09 18:13:53.000000000 -0400
14 +++ linux-2.6.27-521/net/core/skbuff.c  2009-07-23 10:51:52.000000000 -0400
15 @@ -55,6 +55,7 @@
16  #include <linux/rtnetlink.h>
17  #include <linux/init.h>
18  #include <linux/scatterlist.h>
19 +#include <linux/vs_network.h>
20  
21  #include <net/protocol.h>
22  #include <net/dst.h>
23 @@ -209,6 +210,7 @@
24         skb->data = data;
25         skb_reset_tail_pointer(skb);
26         skb->end = skb->tail + size;
27 +       if (!in_interrupt()) skb->skb_tag = nx_current_nid(); else skb->skb_tag = 0;
28         /* make sure we initialize shinfo sequentially */
29         shinfo = skb_shinfo(skb);
30         atomic_set(&shinfo->dataref, 1);
31 @@ -460,6 +462,7 @@
32  #endif
33  #endif
34         new->vlan_tci           = old->vlan_tci;
35 +       new->skb_tag            = old->skb_tag;
36  
37         skb_copy_secmark(new, old);
38  }
39 @@ -490,6 +493,8 @@
40  #endif
41         atomic_set(&n->users, 1);
42  
43 +       /* Sapan: Cloned skbs aren't owned by anyone. Let the cloner decide who it belongs to. */
44 +
45         atomic_inc(&(skb_shinfo(skb)->dataref));
46         skb->cloned = 1;
47  
48 diff -Nurb linux-2.6.27-510/net/core/sock.c linux-2.6.27-521/net/core/sock.c
49 --- linux-2.6.27-510/net/core/sock.c    2009-07-23 10:51:44.000000000 -0400
50 +++ linux-2.6.27-521/net/core/sock.c    2009-11-25 17:36:26.000000000 -0500
51 @@ -954,6 +954,8 @@
52                 sk->sk_prot = sk->sk_prot_creator = prot;
53                 sock_lock_init(sk);
54                 sock_net_set(sk, get_net(net));
55 +        if (!in_interrupt())
56 +            sk->sk_mark = nx_current_nid();
57         }
58  
59         return sk;
60 diff -Nurb linux-2.6.27-510/net/ipv4/af_inet.c linux-2.6.27-521/net/ipv4/af_inet.c
61 --- linux-2.6.27-510/net/ipv4/af_inet.c 2009-07-23 10:51:44.000000000 -0400
62 +++ linux-2.6.27-521/net/ipv4/af_inet.c 2009-07-23 10:51:52.000000000 -0400
63 @@ -181,6 +181,8 @@
64                         return -EAGAIN;
65                 }
66                 inet->sport = htons(inet->num);
67 +               sk->sk_xid = vx_current_xid();
68 +               if (!in_interrupt()) sk->sk_nid = nx_current_nid(); else sk->sk_nid=0;
69         }
70         release_sock(sk);
71         return 0;
72 diff -Nurb linux-2.6.27-510/net/ipv4/netfilter/ipt_LOG.c linux-2.6.27-521/net/ipv4/netfilter/ipt_LOG.c
73 --- linux-2.6.27-510/net/ipv4/netfilter/ipt_LOG.c       2008-10-09 18:13:53.000000000 -0400
74 +++ linux-2.6.27-521/net/ipv4/netfilter/ipt_LOG.c       2009-07-23 10:51:52.000000000 -0400
75 @@ -45,6 +45,8 @@
76         else
77                 logflags = NF_LOG_MASK;
78  
79 +       printk("TAG=%d ", skb->skb_tag);
80 +
81         ih = skb_header_pointer(skb, iphoff, sizeof(_iph), &_iph);
82         if (ih == NULL) {
83                 printk("TRUNCATED");