Identify trellis kernels.
[linux-2.6.git] / linux-2.6-595-vserver-new-netns.patch
1 diff -Nurb linux-2.6.22-594/net/core/dev.c linux-2.6.22-595/net/core/dev.c
2 --- linux-2.6.22-594/net/core/dev.c     2008-03-20 01:27:55.000000000 -0400
3 +++ linux-2.6.22-595/net/core/dev.c     2008-03-20 01:32:22.000000000 -0400
4 @@ -2207,7 +2207,7 @@
5  
6         total = 0;
7         for_each_netdev(net, dev) {
8 -               if (!nx_dev_visible(current->nx_info, dev))
9 +               if (net==&init_net && !nx_dev_visible(current->nx_info, dev))
10                         continue;
11                 for (i = 0; i < NPROTO; i++) {
12                         if (gifconf_list[i]) {
13 @@ -2274,8 +2274,9 @@
14  static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
15  {
16         struct net_device_stats *stats = dev->get_stats(dev);
17 +       struct net *net = seq->private;
18  
19 -       if (!nx_dev_visible(current->nx_info, dev))
20 +       if (net==&init_net && !nx_dev_visible(current->nx_info, dev))
21                 return;
22  
23         seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
24 diff -Nurb linux-2.6.22-594/net/core/net_namespace.c linux-2.6.22-595/net/core/net_namespace.c
25 --- linux-2.6.22-594/net/core/net_namespace.c   2008-03-20 01:27:51.000000000 -0400
26 +++ linux-2.6.22-595/net/core/net_namespace.c   2008-03-20 01:28:00.000000000 -0400
27 @@ -112,10 +112,12 @@
28                 ops = list_entry(ptr, struct pernet_operations, list);
29                 if (ops->init) {
30                         error = ops->init(net);
31 -                       if (error < 0)
32 +                       if (error < 0) {
33 +                               printk(KERN_ALERT "Error setting up netns: %x\n", ops->init);
34                                 goto out_undo;
35                 }
36         }
37 +       }
38  out:
39         return error;
40  out_undo:
41 diff -Nurb linux-2.6.22-594/net/socket.c linux-2.6.22-595/net/socket.c
42 --- linux-2.6.22-594/net/socket.c       2008-03-20 01:27:52.000000000 -0400
43 +++ linux-2.6.22-595/net/socket.c       2008-03-20 01:28:00.000000000 -0400
44 @@ -1122,12 +1122,17 @@
45         if (type < 0 || type >= SOCK_MAX)
46                 return -EINVAL;
47  
48 +       /*
49 +        * Hack no. 2 - Sapan
50 +        * Clean this up later
51 +        *
52         if (!nx_check(0, VS_ADMIN)) {
53                 if (family == PF_INET && !current_nx_info_has_v4())
54                         return -EAFNOSUPPORT;
55                 if (family == PF_INET6 && !current_nx_info_has_v6())
56                         return -EAFNOSUPPORT;
57         }
58 +       */
59  
60         /* Compatibility.
61