DO NOT MERGE: Revert "Revert "ipv6: change route cache aging logic""

This reverts commit 1972036941a5809d7a5d6f8af87ad5654126b6eb.

It only exists to demonstrate the change route cache aging logic test

Change-Id: I32420340c660780b1a77781b293137fd896f22e7
Kunitconfig-Revision: c4ad34242571a1883bdd1db0dae32bb6cc69559d
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a3201a9..77da0c4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1762,12 +1762,19 @@
 	 * EXPIRES exceptions - e.g. pmtu-generated ones are pruned when
 	 * expired, independently from their aging, as per RFC 8201 section 4
 	 */
-	if (!(rt->rt6i_flags & RTF_EXPIRES) &&
-	    time_after_eq(now, rt->dst.lastuse + gc_args->timeout)) {
-		RT6_TRACE("aging clone %p\n", rt);
+	if (!(rt->rt6i_flags & RTF_EXPIRES)) {
+		if (time_after_eq(now, rt->dst.lastuse + gc_args->timeout)) {
+			RT6_TRACE("aging clone %p\n", rt);
+			rt6_remove_exception(bucket, rt6_ex);
+			return;
+		}
+	} else if (time_after(jiffies, rt->dst.expires)) {
+		RT6_TRACE("purging expired route %p\n", rt);
 		rt6_remove_exception(bucket, rt6_ex);
 		return;
-	} else if (rt->rt6i_flags & RTF_GATEWAY) {
+	}
+
+	if (rt->rt6i_flags & RTF_GATEWAY) {
 		struct neighbour *neigh;
 		__u8 neigh_flags = 0;
 
@@ -1781,11 +1788,8 @@
 			rt6_remove_exception(bucket, rt6_ex);
 			return;
 		}
-	} else if (__rt6_check_expired(rt)) {
-		RT6_TRACE("purging expired route %p\n", rt);
-		rt6_remove_exception(bucket, rt6_ex);
-		return;
 	}
+
 	gc_args->more++;
 }