Skip to content

Commit

Permalink
net: ipv6: Refactor in rt6_age_examine_exception
Browse files Browse the repository at this point in the history
The logic in rt6_age_examine_exception is confusing. The commit is
to refactor the code.

Signed-off-by: Xu Jia <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Xu Jia authored and davem330 committed Apr 1, 2021
1 parent f20a46c commit b7a320c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b7a320c

Please sign in to comment.