Skip to contentSkip to conversation

ip route: print RTA_CACHEINFO if it exists

PATCH Superseded [email protected] 1 participant 1 message May 23, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip route: print RTA_CACHEINFO if it exists

From: David Ahern <[email protected]>

RTA_CACHEINFO can be sent for non-cloned routes. If the attribute is present print it. Allows route dumps to print expires times for example which can exist on FIB entries.

---
 ip/iproute.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
ip/iproute.c +5 -9
index 56dd9f25e38e..647c170b1d10 100644
@@ -899,17 +899,13 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			   rta_getattr_u32(tb[RTA_UID]));
 
 	if (r->rtm_family == AF_INET) {
-		if (r->rtm_flags & RTM_F_CLONED) {
-			print_cache_flags(fp, r->rtm_flags);
+		print_cache_flags(fp, r->rtm_flags);
 
-			if (tb[RTA_CACHEINFO])
-				print_rta_cacheinfo(fp, RTA_DATA(tb[RTA_CACHEINFO]));
-		}
+		if (tb[RTA_CACHEINFO])
+			print_rta_cacheinfo(fp, RTA_DATA(tb[RTA_CACHEINFO]));
 	} else if (r->rtm_family == AF_INET6) {
-		if (r->rtm_flags & RTM_F_CLONED) {
-			if (tb[RTA_CACHEINFO])
-				print_rta_cacheinfo(fp, RTA_DATA(tb[RTA_CACHEINFO]));
-		}
+		if (tb[RTA_CACHEINFO])
+			print_rta_cacheinfo(fp, RTA_DATA(tb[RTA_CACHEINFO]));
 	}
 
 	if (tb[RTA_METRICS])
Signature · 1 line
2.11.0