diff options
author | Xu Jia <xujia39@huawei.com> | 2021-04-01 11:22:23 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-01 15:45:26 -0700 |
commit | b7a320c3a1ecb20d24173b668288441dbb7fe7dd (patch) | |
tree | 917fba46db667821ea9cd8d45f9fd0a0bee58b9c /net/ipv6 | |
parent | f20a46c3044c3f75232b3d0e2d09af9b25efaf45 (diff) | |
download | linux-stable-b7a320c3a1ecb20d24173b668288441dbb7fe7dd.tar.gz linux-stable-b7a320c3a1ecb20d24173b668288441dbb7fe7dd.tar.bz2 linux-stable-b7a320c3a1ecb20d24173b668288441dbb7fe7dd.zip |
net: ipv6: Refactor in rt6_age_examine_exception
The logic in rt6_age_examine_exception is confusing. The commit is
to refactor the code.
Signed-off-by: Xu Jia <xujia39@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/route.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d99dd4d36252..28801ae80548 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2085,13 +2085,10 @@ static void rt6_age_examine_exception(struct rt6_exception_bucket *bucket, if (rt->rt6i_flags & RTF_GATEWAY) { struct neighbour *neigh; - __u8 neigh_flags = 0; neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway); - if (neigh) - neigh_flags = neigh->flags; - if (!(neigh_flags & NTF_ROUTER)) { + if (!(neigh && (neigh->flags & NTF_ROUTER))) { RT6_TRACE("purging route %p via non-router but gateway\n", rt); rt6_remove_exception(bucket, rt6_ex); |