mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
ae90bdeaea
commit
c7066f70d9
11 changed files with 37 additions and 38 deletions
|
@ -511,7 +511,7 @@ static const struct file_operations rt_cpu_seq_fops = {
|
|||
.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)
|
||||
{
|
||||
struct ip_rt_acct *dst, *src;
|
||||
|
@ -564,14 +564,14 @@ static int __net_init ip_rt_do_proc_init(struct net *net)
|
|||
if (!pde)
|
||||
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);
|
||||
if (!pde)
|
||||
goto err3;
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
err3:
|
||||
remove_proc_entry("rt_cache", net->proc_net_stat);
|
||||
#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);
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
remove_proc_entry("rt_acct", net->proc_net);
|
||||
#endif
|
||||
}
|
||||
|
@ -1784,7 +1784,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
|
|||
memcpy(addr, &src, 4);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
static void set_class_tag(struct rtable *rt, u32 tag)
|
||||
{
|
||||
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.metrics[RTAX_MTU-1] = 576;
|
||||
}
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
rt->dst.tclassid = FIB_RES_NH(*res).nh_tclassid;
|
||||
#endif
|
||||
} 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)
|
||||
rt->dst.metrics[RTAX_ADVMSS-1] = 65535 - 40;
|
||||
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
#ifdef CONFIG_IP_MULTIPLE_TABLES
|
||||
set_class_tag(rt, fib_rules_tclass(res));
|
||||
#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.fl4_src = saddr;
|
||||
rth->rt_src = saddr;
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
rth->dst.tclassid = itag;
|
||||
#endif
|
||||
rth->rt_iif =
|
||||
|
@ -2202,7 +2202,7 @@ local_input:
|
|||
rth->fl.mark = skb->mark;
|
||||
rth->fl.fl4_src = saddr;
|
||||
rth->rt_src = saddr;
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
rth->dst.tclassid = itag;
|
||||
#endif
|
||||
rth->rt_iif =
|
||||
|
@ -2820,7 +2820,7 @@ static int rt_fill_info(struct net *net,
|
|||
}
|
||||
if (rt->dst.dev)
|
||||
NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex);
|
||||
#ifdef CONFIG_NET_CLS_ROUTE
|
||||
#ifdef CONFIG_IP_ROUTE_CLASSID
|
||||
if (rt->dst.tclassid)
|
||||
NLA_PUT_U32(skb, RTA_FLOW, rt->dst.tclassid);
|
||||
#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;
|
||||
#endif /* CONFIG_NET_CLS_ROUTE */
|
||||
#endif /* CONFIG_IP_ROUTE_CLASSID */
|
||||
|
||||
static __initdata unsigned long rhash_entries;
|
||||
static int __init set_rhash_entries(char *str)
|
||||
|
@ -3263,7 +3263,7 @@ int __init ip_rt_init(void)
|
|||
{
|
||||
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));
|
||||
if (!ip_rt_acct)
|
||||
panic("IP: failed to allocate ip_rt_acct\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue