Bump tag level
[linux-2.6.git] / linux-2.6-521-packet-tagging.patch
1 diff -NurpP --exclude '*.orig' --exclude '*.rej' linux-2.6.27.10-vs2.3.x-P/include/linux/skbuff.h linux-2.6.27.10-vs2.3.x-P521/include/linux/skbuff.h
2 --- linux-2.6.27.10-vs2.3.x-P/include/linux/skbuff.h    2008-10-13 14:52:09.000000000 +0200
3 +++ linux-2.6.27.10-vs2.3.x-P521/include/linux/skbuff.h 2009-01-12 01:18:23.000000000 +0100
4 @@ -330,6 +330,7 @@ struct sk_buff {
5  #endif
6  
7         __u32                   mark;
8 +#define skb_tag                        mark
9  
10         __u16                   vlan_tci;
11  
12 diff -NurpP --exclude '*.orig' --exclude '*.rej' linux-2.6.27.10-vs2.3.x-P/net/core/skbuff.c linux-2.6.27.10-vs2.3.x-P521/net/core/skbuff.c
13 --- linux-2.6.27.10-vs2.3.x-P/net/core/skbuff.c 2008-10-13 14:52:09.000000000 +0200
14 +++ linux-2.6.27.10-vs2.3.x-P521/net/core/skbuff.c      2009-01-12 01:56:55.000000000 +0100
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 @@ struct sk_buff *__alloc_skb(unsigned int
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 @@ static void __copy_skb_header(struct sk_
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 @@ static struct sk_buff *__skb_clone(struc
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 -NurpP --exclude '*.orig' --exclude '*.rej' linux-2.6.27.10-vs2.3.x-P/net/ipv4/af_inet.c linux-2.6.27.10-vs2.3.x-P521/net/ipv4/af_inet.c
49 --- linux-2.6.27.10-vs2.3.x-P/net/ipv4/af_inet.c        2008-10-13 14:54:20.000000000 +0200
50 +++ linux-2.6.27.10-vs2.3.x-P521/net/ipv4/af_inet.c     2009-01-12 01:18:23.000000000 +0100
51 @@ -181,6 +181,8 @@ static int inet_autobind(struct sock *sk
52                         return -EAGAIN;
53                 }
54                 inet->sport = htons(inet->num);
55 +               sk->sk_xid = vx_current_xid();
56 +               if (!in_interrupt()) sk->sk_nid = nx_current_nid(); else sk->sk_nid=0;
57         }
58         release_sock(sk);
59         return 0;
60 diff -NurpP --exclude '*.orig' --exclude '*.rej' linux-2.6.27.10-vs2.3.x-P/net/ipv4/netfilter/ipt_LOG.c linux-2.6.27.10-vs2.3.x-P521/net/ipv4/netfilter/ipt_LOG.c
61 --- linux-2.6.27.10-vs2.3.x-P/net/ipv4/netfilter/ipt_LOG.c      2008-07-13 23:51:29.000000000 +0200
62 +++ linux-2.6.27.10-vs2.3.x-P521/net/ipv4/netfilter/ipt_LOG.c   2009-01-12 01:18:23.000000000 +0100
63 @@ -45,6 +45,8 @@ static void dump_packet(const struct nf_
64         else
65                 logflags = NF_LOG_MASK;
66  
67 +       printk("TAG=%d ", skb->skb_tag);
68 +
69         ih = skb_header_pointer(skb, iphoff, sizeof(_iph), &_iph);
70         if (ih == NULL) {
71                 printk("TRUNCATED");