]> err.no Git - linux-2.6/blobdiff - net/ipv6/route.c
ipv6: replace dst_metric() with dst_mtu() in net/ipv6/route.c.
[linux-2.6] / net / ipv6 / route.c
index fb7ff8f0c6dbf3c4b16d0fc2a048ca3732964dbe..5a3e87e4b18f003357720a7f79e3e6b665fb9055 100644 (file)
@@ -676,7 +676,7 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
        int strict = 0;
        int attempts = 3;
        int err;
-       int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
+       int reachable = net->ipv6.devconf_all->forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
 
        strict |= flags & RT6_LOOKUP_F_IFACE;
 
@@ -978,13 +978,12 @@ out:
        return &rt->u.dst;
 }
 
-int icmp6_dst_gc(int *more)
+int icmp6_dst_gc(void)
 {
        struct dst_entry *dst, *next, **pprev;
-       int freed;
+       int more = 0;
 
        next = NULL;
-       freed = 0;
 
        spin_lock_bh(&icmp6_dst_lock);
        pprev = &icmp6_dst_gc_list;
@@ -993,16 +992,15 @@ int icmp6_dst_gc(int *more)
                if (!atomic_read(&dst->__refcnt)) {
                        *pprev = dst->next;
                        dst_free(dst);
-                       freed++;
                } else {
                        pprev = &dst->next;
-                       (*more)++;
+                       ++more;
                }
        }
 
        spin_unlock_bh(&icmp6_dst_lock);
 
-       return freed;
+       return more;
 }
 
 static int ip6_dst_gc(struct dst_ops *ops)
@@ -1058,7 +1056,7 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
                        hoplimit = idev->cnf.hop_limit;
                        in6_dev_put(idev);
                } else
-                       hoplimit = ipv6_devconf.hop_limit;
+                       hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit;
        }
        return hoplimit;
 }
@@ -1251,7 +1249,7 @@ install_route:
 
        if (dst_metric(&rt->u.dst, RTAX_HOPLIMIT) == 0)
                rt->u.dst.metrics[RTAX_HOPLIMIT-1] = -1;
-       if (!dst_metric(&rt->u.dst, RTAX_MTU))
+       if (!dst_mtu(&rt->u.dst))
                rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(dev);
        if (!dst_metric(&rt->u.dst, RTAX_ADVMSS))
                rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(net, dst_mtu(&rt->u.dst));
@@ -2419,20 +2417,12 @@ static int ipv6_route_open(struct inode *inode, struct file *file)
        return single_open_net(inode, file, ipv6_route_show);
 }
 
-static int ipv6_route_release(struct inode *inode, struct file *file)
-{
-       struct seq_file *seq = file->private_data;
-       struct net *net = seq->private;
-       put_net(net);
-       return single_release(inode, file);
-}
-
 static const struct file_operations ipv6_route_proc_fops = {
        .owner          = THIS_MODULE,
        .open           = ipv6_route_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = ipv6_route_release,
+       .release        = single_release_net,
 };
 
 static int rt6_stats_seq_show(struct seq_file *seq, void *v)
@@ -2455,20 +2445,12 @@ static int rt6_stats_seq_open(struct inode *inode, struct file *file)
        return single_open_net(inode, file, rt6_stats_seq_show);
 }
 
-static int rt6_stats_seq_release(struct inode *inode, struct file *file)
-{
-       struct seq_file *seq = file->private_data;
-       struct net *net = (struct net *)seq->private;
-       put_net(net);
-       return single_release(inode, file);
-}
-
 static const struct file_operations rt6_stats_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = rt6_stats_seq_open,
        .read    = seq_read,
        .llseek  = seq_lseek,
-       .release = rt6_stats_seq_release,
+       .release = single_release_net,
 };
 #endif /* CONFIG_PROC_FS */