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
				
			
		| 
						 | 
				
			
			@ -200,7 +200,7 @@ static inline int nh_comp(const struct fib_info *fi, const struct fib_info *ofi)
 | 
			
		|||
#ifdef CONFIG_IP_ROUTE_MULTIPATH
 | 
			
		||||
		    nh->nh_weight != onh->nh_weight ||
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
		    nh->nh_tclassid != onh->nh_tclassid ||
 | 
			
		||||
#endif
 | 
			
		||||
		    ((nh->nh_flags ^ onh->nh_flags) & ~RTNH_F_DEAD))
 | 
			
		||||
| 
						 | 
				
			
			@ -422,7 +422,7 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
 | 
			
		|||
 | 
			
		||||
			nla = nla_find(attrs, attrlen, RTA_GATEWAY);
 | 
			
		||||
			nexthop_nh->nh_gw = nla ? nla_get_be32(nla) : 0;
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
			nla = nla_find(attrs, attrlen, RTA_FLOW);
 | 
			
		||||
			nexthop_nh->nh_tclassid = nla ? nla_get_u32(nla) : 0;
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -476,7 +476,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
 | 
			
		|||
			nla = nla_find(attrs, attrlen, RTA_GATEWAY);
 | 
			
		||||
			if (nla && nla_get_be32(nla) != nh->nh_gw)
 | 
			
		||||
				return 1;
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
			nla = nla_find(attrs, attrlen, RTA_FLOW);
 | 
			
		||||
			if (nla && nla_get_u32(nla) != nh->nh_tclassid)
 | 
			
		||||
				return 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -783,7 +783,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
 | 
			
		|||
			goto err_inval;
 | 
			
		||||
		if (cfg->fc_gw && fi->fib_nh->nh_gw != cfg->fc_gw)
 | 
			
		||||
			goto err_inval;
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
		if (cfg->fc_flow && fi->fib_nh->nh_tclassid != cfg->fc_flow)
 | 
			
		||||
			goto err_inval;
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -796,7 +796,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
 | 
			
		|||
		nh->nh_oif = cfg->fc_oif;
 | 
			
		||||
		nh->nh_gw = cfg->fc_gw;
 | 
			
		||||
		nh->nh_flags = cfg->fc_flags;
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
		nh->nh_tclassid = cfg->fc_flow;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_MULTIPATH
 | 
			
		||||
| 
						 | 
				
			
			@ -1006,7 +1006,7 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
 | 
			
		|||
 | 
			
		||||
		if (fi->fib_nh->nh_oif)
 | 
			
		||||
			NLA_PUT_U32(skb, RTA_OIF, fi->fib_nh->nh_oif);
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
		if (fi->fib_nh[0].nh_tclassid)
 | 
			
		||||
			NLA_PUT_U32(skb, RTA_FLOW, fi->fib_nh[0].nh_tclassid);
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -1031,7 +1031,7 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
 | 
			
		|||
 | 
			
		||||
			if (nh->nh_gw)
 | 
			
		||||
				NLA_PUT_BE32(skb, RTA_GATEWAY, nh->nh_gw);
 | 
			
		||||
#ifdef CONFIG_NET_CLS_ROUTE
 | 
			
		||||
#ifdef CONFIG_IP_ROUTE_CLASSID
 | 
			
		||||
			if (nh->nh_tclassid)
 | 
			
		||||
				NLA_PUT_U32(skb, RTA_FLOW, nh->nh_tclassid);
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue