diff options
Diffstat (limited to 'net/ipv6/fib6_rules.c')
| -rw-r--r-- | net/ipv6/fib6_rules.c | 22 | 
1 files changed, 6 insertions, 16 deletions
| diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index eea23b57c6a5..ec849d88a662 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c @@ -32,7 +32,6 @@ struct fib6_rule {  struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,  				   int flags, pol_lookup_t lookup)  { -	struct rt6_info *rt;  	struct fib_lookup_arg arg = {  		.lookup_ptr = lookup,  		.flags = FIB_LOOKUP_NOREF, @@ -44,21 +43,11 @@ struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,  	fib_rules_lookup(net->ipv6.fib6_rules_ops,  			 flowi6_to_flowi(fl6), flags, &arg); -	rt = arg.result; +	if (arg.result) +		return arg.result; -	if (!rt) { -		dst_hold(&net->ipv6.ip6_null_entry->dst); -		return &net->ipv6.ip6_null_entry->dst; -	} - -	if (rt->rt6i_flags & RTF_REJECT && -	    rt->dst.error == -EAGAIN) { -		ip6_rt_put(rt); -		rt = net->ipv6.ip6_null_entry; -		dst_hold(&rt->dst); -	} - -	return &rt->dst; +	dst_hold(&net->ipv6.ip6_null_entry->dst); +	return &net->ipv6.ip6_null_entry->dst;  }  static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp, @@ -121,7 +110,8 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,  			flp6->saddr = saddr;  		}  		err = rt->dst.error; -		goto out; +		if (err != -EAGAIN) +			goto out;  	}  again:  	ip6_rt_put(rt); |