|
@@ -511,7 +511,7 @@ static const struct file_operations rt_cpu_seq_fops = {
|
|
.release = seq_release,
|
|
.release = seq_release,
|
|
};
|
|
};
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
static int rt_acct_proc_show(struct seq_file *m, void *v)
|
|
static int rt_acct_proc_show(struct seq_file *m, void *v)
|
|
{
|
|
{
|
|
struct ip_rt_acct *dst, *src;
|
|
struct ip_rt_acct *dst, *src;
|
|
@@ -564,14 +564,14 @@ static int __net_init ip_rt_do_proc_init(struct net *net)
|
|
if (!pde)
|
|
if (!pde)
|
|
goto err2;
|
|
goto err2;
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
pde = proc_create("rt_acct", 0, net->proc_net, &rt_acct_proc_fops);
|
|
pde = proc_create("rt_acct", 0, net->proc_net, &rt_acct_proc_fops);
|
|
if (!pde)
|
|
if (!pde)
|
|
goto err3;
|
|
goto err3;
|
|
#endif
|
|
#endif
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
err3:
|
|
err3:
|
|
remove_proc_entry("rt_cache", net->proc_net_stat);
|
|
remove_proc_entry("rt_cache", net->proc_net_stat);
|
|
#endif
|
|
#endif
|
|
@@ -585,7 +585,7 @@ static void __net_exit ip_rt_do_proc_exit(struct net *net)
|
|
{
|
|
{
|
|
remove_proc_entry("rt_cache", net->proc_net_stat);
|
|
remove_proc_entry("rt_cache", net->proc_net_stat);
|
|
remove_proc_entry("rt_cache", net->proc_net);
|
|
remove_proc_entry("rt_cache", net->proc_net);
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
remove_proc_entry("rt_acct", net->proc_net);
|
|
remove_proc_entry("rt_acct", net->proc_net);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
@@ -1784,7 +1784,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
|
|
memcpy(addr, &src, 4);
|
|
memcpy(addr, &src, 4);
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
static void set_class_tag(struct rtable *rt, u32 tag)
|
|
static void set_class_tag(struct rtable *rt, u32 tag)
|
|
{
|
|
{
|
|
if (!(rt->dst.tclassid & 0xFFFF))
|
|
if (!(rt->dst.tclassid & 0xFFFF))
|
|
@@ -1811,7 +1811,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
|
|
rt->dst.dev->mtu > 576)
|
|
rt->dst.dev->mtu > 576)
|
|
rt->dst.metrics[RTAX_MTU-1] = 576;
|
|
rt->dst.metrics[RTAX_MTU-1] = 576;
|
|
}
|
|
}
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
rt->dst.tclassid = FIB_RES_NH(*res).nh_tclassid;
|
|
rt->dst.tclassid = FIB_RES_NH(*res).nh_tclassid;
|
|
#endif
|
|
#endif
|
|
} else
|
|
} else
|
|
@@ -1827,7 +1827,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
|
|
if (dst_metric(&rt->dst, RTAX_ADVMSS) > 65535 - 40)
|
|
if (dst_metric(&rt->dst, RTAX_ADVMSS) > 65535 - 40)
|
|
rt->dst.metrics[RTAX_ADVMSS-1] = 65535 - 40;
|
|
rt->dst.metrics[RTAX_ADVMSS-1] = 65535 - 40;
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
#ifdef CONFIG_IP_MULTIPLE_TABLES
|
|
#ifdef CONFIG_IP_MULTIPLE_TABLES
|
|
set_class_tag(rt, fib_rules_tclass(res));
|
|
set_class_tag(rt, fib_rules_tclass(res));
|
|
#endif
|
|
#endif
|
|
@@ -1883,7 +1883,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
|
|
rth->fl.mark = skb->mark;
|
|
rth->fl.mark = skb->mark;
|
|
rth->fl.fl4_src = saddr;
|
|
rth->fl.fl4_src = saddr;
|
|
rth->rt_src = saddr;
|
|
rth->rt_src = saddr;
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
rth->dst.tclassid = itag;
|
|
rth->dst.tclassid = itag;
|
|
#endif
|
|
#endif
|
|
rth->rt_iif =
|
|
rth->rt_iif =
|
|
@@ -2202,7 +2202,7 @@ local_input:
|
|
rth->fl.mark = skb->mark;
|
|
rth->fl.mark = skb->mark;
|
|
rth->fl.fl4_src = saddr;
|
|
rth->fl.fl4_src = saddr;
|
|
rth->rt_src = saddr;
|
|
rth->rt_src = saddr;
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
rth->dst.tclassid = itag;
|
|
rth->dst.tclassid = itag;
|
|
#endif
|
|
#endif
|
|
rth->rt_iif =
|
|
rth->rt_iif =
|
|
@@ -2820,7 +2820,7 @@ static int rt_fill_info(struct net *net,
|
|
}
|
|
}
|
|
if (rt->dst.dev)
|
|
if (rt->dst.dev)
|
|
NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex);
|
|
NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex);
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
if (rt->dst.tclassid)
|
|
if (rt->dst.tclassid)
|
|
NLA_PUT_U32(skb, RTA_FLOW, rt->dst.tclassid);
|
|
NLA_PUT_U32(skb, RTA_FLOW, rt->dst.tclassid);
|
|
#endif
|
|
#endif
|
|
@@ -3245,9 +3245,9 @@ static __net_initdata struct pernet_operations rt_genid_ops = {
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
struct ip_rt_acct __percpu *ip_rt_acct __read_mostly;
|
|
struct ip_rt_acct __percpu *ip_rt_acct __read_mostly;
|
|
-#endif /* CONFIG_NET_CLS_ROUTE */
|
|
|
|
|
|
+#endif /* CONFIG_IP_ROUTE_CLASSID */
|
|
|
|
|
|
static __initdata unsigned long rhash_entries;
|
|
static __initdata unsigned long rhash_entries;
|
|
static int __init set_rhash_entries(char *str)
|
|
static int __init set_rhash_entries(char *str)
|
|
@@ -3263,7 +3263,7 @@ int __init ip_rt_init(void)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|
|
|
|
|
|
-#ifdef CONFIG_NET_CLS_ROUTE
|
|
|
|
|
|
+#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct), __alignof__(struct ip_rt_acct));
|
|
ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct), __alignof__(struct ip_rt_acct));
|
|
if (!ip_rt_acct)
|
|
if (!ip_rt_acct)
|
|
panic("IP: failed to allocate ip_rt_acct\n");
|
|
panic("IP: failed to allocate ip_rt_acct\n");
|