* [PATCH v2 iproute2-next] ip route: print RTA_CACHEINFO if it exists
@ 2018-05-30 15:30 dsahern
2018-06-01 20:00 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: dsahern @ 2018-05-30 15:30 UTC (permalink / raw)
To: netdev, stephen; +Cc: David Ahern
From: David Ahern <dsahern@gmail.com>
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.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
v2
- leave print_cache_flags under r->rtm_flags & RTM_F_CLONED check
ip/iproute.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 56dd9f25e38e..254d7abd2abf 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -899,17 +899,14 @@ 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) {
+ if (r->rtm_flags & RTM_F_CLONED)
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])
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 iproute2-next] ip route: print RTA_CACHEINFO if it exists
2018-05-30 15:30 [PATCH v2 iproute2-next] ip route: print RTA_CACHEINFO if it exists dsahern
@ 2018-06-01 20:00 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2018-06-01 20:00 UTC (permalink / raw)
To: dsahern; +Cc: netdev, David Ahern
On Wed, 30 May 2018 08:30:09 -0700
dsahern@kernel.org wrote:
> From: David Ahern <dsahern@gmail.com>
>
> 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.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-01 20:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-30 15:30 [PATCH v2 iproute2-next] ip route: print RTA_CACHEINFO if it exists dsahern
2018-06-01 20:00 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.