* [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
* Re: [PATCH iproute2] ip route: Add annotation for replaced routes
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
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2016-06-14 21:34 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
On Thu, 9 Jun 2016 13:05:42 -0700
David Ahern <dsa@cumulusnetworks.com> wrote:
> 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>
Why just routes, there are several other places where Replaced entries could
be returned?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] ip route: Add annotation for replaced routes
2016-06-14 21:34 ` Stephen Hemminger
@ 2016-06-14 21:37 ` David Ahern
0 siblings, 0 replies; 3+ messages in thread
From: David Ahern @ 2016-06-14 21:37 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
On 6/14/16 3:34 PM, Stephen Hemminger wrote:
> On Thu, 9 Jun 2016 13:05:42 -0700
> David Ahern <dsa@cumulusnetworks.com> wrote:
>
>> 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>
>
> Why just routes, there are several other places where Replaced entries could
> be returned?
>
b/c that's the use case I was investigating. :-)
Will add the others.
^ permalink raw reply [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.