diff options
author | Patrick McHardy <kaber@trash.net> | 2011-01-14 07:36:42 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-01-14 07:36:42 -0500 |
commit | c7066f70d9610df0b9406cc635fc09e86136e714 (patch) | |
tree | ce98855b2c1ba2da15b7b47fc7a447d1903c4d89 /net/ipv4/route.c | |
parent | ae90bdeaeac6b964b7a1e853a90a19f358a9ac20 (diff) |
netfilter: fix Kconfig dependencies
Fix dependencies of netfilter realm match: it depends on NET_CLS_ROUTE,
which itself depends on NET_SCHED; this dependency is missing from netfilter.
Since matching on realms is also useful without having NET_SCHED enabled and
the option really only controls whether the tclassid member is included in
route and dst entries, rename the config option to IP_ROUTE_CLASSID and move
it outside of traffic scheduling context to get rid of the NET_SCHED dependeny.
Reported-by: Vladis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 66610ea3c87b..f70ae1bccb8a 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -511,7 +511,7 @@ static const struct file_operations rt_cpu_seq_fops = { | |||
511 | .release = seq_release, | 511 | .release = seq_release, |
512 | }; | 512 | }; |
513 | 513 | ||
514 | #ifdef CONFIG_NET_CLS_ROUTE | 514 | #ifdef CONFIG_IP_ROUTE_CLASSID |
515 | static int rt_acct_proc_show(struct seq_file *m, void *v) | 515 | static int rt_acct_proc_show(struct seq_file *m, void *v) |
516 | { | 516 | { |
517 | struct ip_rt_acct *dst, *src; | 517 | struct ip_rt_acct *dst, *src; |
@@ -564,14 +564,14 @@ static int __net_init ip_rt_do_proc_init(struct net *net) | |||
564 | if (!pde) | 564 | if (!pde) |
565 | goto err2; | 565 | goto err2; |
566 | 566 | ||
567 | #ifdef CONFIG_NET_CLS_ROUTE | 567 | #ifdef CONFIG_IP_ROUTE_CLASSID |
568 | pde = proc_create("rt_acct", 0, net->proc_net, &rt_acct_proc_fops); | 568 | pde = proc_create("rt_acct", 0, net->proc_net, &rt_acct_proc_fops); |
569 | if (!pde) | 569 | if (!pde) |
570 | goto err3; | 570 | goto err3; |
571 | #endif | 571 | #endif |
572 | return 0; | 572 | return 0; |
573 | 573 | ||
574 | #ifdef CONFIG_NET_CLS_ROUTE | 574 | #ifdef CONFIG_IP_ROUTE_CLASSID |
575 | err3: | 575 | err3: |
576 | remove_proc_entry("rt_cache", net->proc_net_stat); | 576 | remove_proc_entry("rt_cache", net->proc_net_stat); |
577 | #endif | 577 | #endif |
@@ -585,7 +585,7 @@ static void __net_exit ip_rt_do_proc_exit(struct net *net) | |||
585 | { | 585 | { |
586 | remove_proc_entry("rt_cache", net->proc_net_stat); | 586 | remove_proc_entry("rt_cache", net->proc_net_stat); |
587 | remove_proc_entry("rt_cache", net->proc_net); | 587 | remove_proc_entry("rt_cache", net->proc_net); |
588 | #ifdef CONFIG_NET_CLS_ROUTE | 588 | #ifdef CONFIG_IP_ROUTE_CLASSID |
589 | remove_proc_entry("rt_acct", net->proc_net); | 589 | remove_proc_entry("rt_acct", net->proc_net); |
590 | #endif | 590 | #endif |
591 | } | 591 | } |
@@ -1784,7 +1784,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt) | |||
1784 | memcpy(addr, &src, 4); | 1784 | memcpy(addr, &src, 4); |
1785 | } | 1785 | } |
1786 | 1786 | ||
1787 | #ifdef CONFIG_NET_CLS_ROUTE | 1787 | #ifdef CONFIG_IP_ROUTE_CLASSID |
1788 | static void set_class_tag(struct rtable *rt, u32 tag) | 1788 | static void set_class_tag(struct rtable *rt, u32 tag) |
1789 | { | 1789 | { |
1790 | if (!(rt->dst.tclassid & 0xFFFF)) | 1790 | if (!(rt->dst.tclassid & 0xFFFF)) |
@@ -1811,7 +1811,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag) | |||
1811 | rt->dst.dev->mtu > 576) | 1811 | rt->dst.dev->mtu > 576) |
1812 | rt->dst.metrics[RTAX_MTU-1] = 576; | 1812 | rt->dst.metrics[RTAX_MTU-1] = 576; |
1813 | } | 1813 | } |
1814 | #ifdef CONFIG_NET_CLS_ROUTE | 1814 | #ifdef CONFIG_IP_ROUTE_CLASSID |
1815 | rt->dst.tclassid = FIB_RES_NH(*res).nh_tclassid; | 1815 | rt->dst.tclassid = FIB_RES_NH(*res).nh_tclassid; |
1816 | #endif | 1816 | #endif |
1817 | } else | 1817 | } else |
@@ -1827,7 +1827,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag) | |||
1827 | if (dst_metric(&rt->dst, RTAX_ADVMSS) > 65535 - 40) | 1827 | if (dst_metric(&rt->dst, RTAX_ADVMSS) > 65535 - 40) |
1828 | rt->dst.metrics[RTAX_ADVMSS-1] = 65535 - 40; | 1828 | rt->dst.metrics[RTAX_ADVMSS-1] = 65535 - 40; |
1829 | 1829 | ||
1830 | #ifdef CONFIG_NET_CLS_ROUTE | 1830 | #ifdef CONFIG_IP_ROUTE_CLASSID |
1831 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 1831 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
1832 | set_class_tag(rt, fib_rules_tclass(res)); | 1832 | set_class_tag(rt, fib_rules_tclass(res)); |
1833 | #endif | 1833 | #endif |
@@ -1883,7 +1883,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1883 | rth->fl.mark = skb->mark; | 1883 | rth->fl.mark = skb->mark; |
1884 | rth->fl.fl4_src = saddr; | 1884 | rth->fl.fl4_src = saddr; |
1885 | rth->rt_src = saddr; | 1885 | rth->rt_src = saddr; |
1886 | #ifdef CONFIG_NET_CLS_ROUTE | 1886 | #ifdef CONFIG_IP_ROUTE_CLASSID |
1887 | rth->dst.tclassid = itag; | 1887 | rth->dst.tclassid = itag; |
1888 | #endif | 1888 | #endif |
1889 | rth->rt_iif = | 1889 | rth->rt_iif = |
@@ -2202,7 +2202,7 @@ local_input: | |||
2202 | rth->fl.mark = skb->mark; | 2202 | rth->fl.mark = skb->mark; |
2203 | rth->fl.fl4_src = saddr; | 2203 | rth->fl.fl4_src = saddr; |
2204 | rth->rt_src = saddr; | 2204 | rth->rt_src = saddr; |
2205 | #ifdef CONFIG_NET_CLS_ROUTE | 2205 | #ifdef CONFIG_IP_ROUTE_CLASSID |
2206 | rth->dst.tclassid = itag; | 2206 | rth->dst.tclassid = itag; |
2207 | #endif | 2207 | #endif |
2208 | rth->rt_iif = | 2208 | rth->rt_iif = |
@@ -2820,7 +2820,7 @@ static int rt_fill_info(struct net *net, | |||
2820 | } | 2820 | } |
2821 | if (rt->dst.dev) | 2821 | if (rt->dst.dev) |
2822 | NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex); | 2822 | NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex); |
2823 | #ifdef CONFIG_NET_CLS_ROUTE | 2823 | #ifdef CONFIG_IP_ROUTE_CLASSID |
2824 | if (rt->dst.tclassid) | 2824 | if (rt->dst.tclassid) |
2825 | NLA_PUT_U32(skb, RTA_FLOW, rt->dst.tclassid); | 2825 | NLA_PUT_U32(skb, RTA_FLOW, rt->dst.tclassid); |
2826 | #endif | 2826 | #endif |
@@ -3245,9 +3245,9 @@ static __net_initdata struct pernet_operations rt_genid_ops = { | |||
3245 | }; | 3245 | }; |
3246 | 3246 | ||
3247 | 3247 | ||
3248 | #ifdef CONFIG_NET_CLS_ROUTE | 3248 | #ifdef CONFIG_IP_ROUTE_CLASSID |
3249 | struct ip_rt_acct __percpu *ip_rt_acct __read_mostly; | 3249 | struct ip_rt_acct __percpu *ip_rt_acct __read_mostly; |
3250 | #endif /* CONFIG_NET_CLS_ROUTE */ | 3250 | #endif /* CONFIG_IP_ROUTE_CLASSID */ |
3251 | 3251 | ||
3252 | static __initdata unsigned long rhash_entries; | 3252 | static __initdata unsigned long rhash_entries; |
3253 | static int __init set_rhash_entries(char *str) | 3253 | static int __init set_rhash_entries(char *str) |
@@ -3263,7 +3263,7 @@ int __init ip_rt_init(void) | |||
3263 | { | 3263 | { |
3264 | int rc = 0; | 3264 | int rc = 0; |
3265 | 3265 | ||
3266 | #ifdef CONFIG_NET_CLS_ROUTE | 3266 | #ifdef CONFIG_IP_ROUTE_CLASSID |
3267 | ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct), __alignof__(struct ip_rt_acct)); | 3267 | ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acct), __alignof__(struct ip_rt_acct)); |
3268 | if (!ip_rt_acct) | 3268 | if (!ip_rt_acct) |
3269 | panic("IP: failed to allocate ip_rt_acct\n"); | 3269 | panic("IP: failed to allocate ip_rt_acct\n"); |