All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] ip route: Add annotation for replaced routes
@ 2016-06-09 20:05 David Ahern
  2016-06-14 21:34 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2016-06-09 20:05 UTC (permalink / raw)
  To: netdev; +Cc: stephen, David Ahern

If NLM_F_REPLACE flag is set then a route is replacing an existing route.
Prepend "Replaced " to these routes similar to how "Deleted " is added
to deleted routes.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
 ip/iproute.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ip/iproute.c b/ip/iproute.c
index 8224d7ffa94b..28b47bcb7312 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -363,6 +363,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			return 0;
 	}
 
+	if (n->nlmsg_flags & NLM_F_REPLACE)
+		fprintf(fp, "Replaced ");
 	if (n->nlmsg_type == RTM_DELROUTE)
 		fprintf(fp, "Deleted ");
 	if ((r->rtm_type != RTN_UNICAST || show_details > 0) && !filter.type)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-14 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09 20:05 [PATCH iproute2] ip route: Add annotation for replaced routes David Ahern
2016-06-14 21:34 ` Stephen Hemminger
2016-06-14 21:37   ` David Ahern

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.