net/ipv6: Cleanup exception and cache route handling
IPv6 FIB will only contain FIB entries with exception routes added to the FIB entry. Once this transformation is complete, FIB lookups will return a fib6_info with the lookup functions still returning a dst based rt6_info. The current code uses rt6_info for both paths and overloads the rt6_info variable usually called 'rt'. This patch introduces a new 'f6i' variable name for the result of the FIB lookup and keeps 'rt' as the dst based return variable. 'f6i' becomes a fib6_info in a later patch which is why it is introduced as f6i now; avoids the additional churn in the later patch. In addition, remove RTF_CACHE and dst checks from fib6 add and delete since they can not happen now and will never happen after the data type flip. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
acb54e3cba
commit
23fb93a4d3
@@ -1074,7 +1074,7 @@ add:
|
||||
static void fib6_start_gc(struct net *net, struct rt6_info *rt)
|
||||
{
|
||||
if (!timer_pending(&net->ipv6.ip6_fib_timer) &&
|
||||
(rt->rt6i_flags & (RTF_EXPIRES | RTF_CACHE)))
|
||||
(rt->rt6i_flags & RTF_EXPIRES))
|
||||
mod_timer(&net->ipv6.ip6_fib_timer,
|
||||
jiffies + net->ipv6.sysctl.ip6_rt_gc_interval);
|
||||
}
|
||||
@@ -1125,8 +1125,6 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
|
||||
|
||||
if (WARN_ON_ONCE(!atomic_read(&rt->dst.__refcnt)))
|
||||
return -EINVAL;
|
||||
if (WARN_ON_ONCE(rt->rt6i_flags & RTF_CACHE))
|
||||
return -EINVAL;
|
||||
|
||||
if (info->nlh) {
|
||||
if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
|
||||
@@ -1650,8 +1648,6 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
|
||||
|
||||
RT6_TRACE("fib6_del_route\n");
|
||||
|
||||
WARN_ON_ONCE(rt->rt6i_flags & RTF_CACHE);
|
||||
|
||||
/* Unlink it */
|
||||
*rtp = rt->rt6_next;
|
||||
rt->rt6i_node = NULL;
|
||||
@@ -1720,21 +1716,11 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
|
||||
struct rt6_info __rcu **rtp;
|
||||
struct rt6_info __rcu **rtp_next;
|
||||
|
||||
#if RT6_DEBUG >= 2
|
||||
if (rt->dst.obsolete > 0) {
|
||||
WARN_ON(fn);
|
||||
return -ENOENT;
|
||||
}
|
||||
#endif
|
||||
if (!fn || rt == net->ipv6.fib6_null_entry)
|
||||
return -ENOENT;
|
||||
|
||||
WARN_ON(!(fn->fn_flags & RTN_RTINFO));
|
||||
|
||||
/* remove cached dst from exception table */
|
||||
if (rt->rt6i_flags & RTF_CACHE)
|
||||
return rt6_remove_exception_rt(rt);
|
||||
|
||||
/*
|
||||
* Walk the leaf entries looking for ourself
|
||||
*/
|
||||
|
Reference in New Issue
Block a user