]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/802/tr.c
[NET]: Make the device list and device lookups per namespace.
[net-next-2.6.git] / net / 802 / tr.c
index 0ba1946211c935e79883963c21782f7258bb5726..55c76d77d3223e3ca6248916a86c6b2011916daa 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/seq_file.h>
 #include <linux/init.h>
 #include <net/arp.h>
+#include <net/net_namespace.h>
 
 static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev);
 static void rif_check_expire(unsigned long dummy);
@@ -532,7 +533,7 @@ static int rif_seq_show(struct seq_file *seq, void *v)
                seq_puts(seq,
                     "if     TR address       TTL   rcf   routing segments\n");
        else {
-               struct net_device *dev = dev_get_by_index(entry->iface);
+               struct net_device *dev = dev_get_by_index(&init_net, entry->iface);
                long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout)
                                - (long) jiffies;
 
@@ -567,7 +568,7 @@ static int rif_seq_show(struct seq_file *seq, void *v)
 }
 
 
-static struct seq_operations rif_seq_ops = {
+static const struct seq_operations rif_seq_ops = {
        .start = rif_seq_start,
        .next  = rif_seq_next,
        .stop  = rif_seq_stop,
@@ -639,7 +640,7 @@ static int __init rif_init(void)
        rif_timer.function = rif_check_expire;
        add_timer(&rif_timer);
 
-       proc_net_fops_create("tr_rif", S_IRUGO, &rif_seq_fops);
+       proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
        return 0;
 }