All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ip: Display ip rule protocol used
@ 2018-02-17 12:47 Donald Sharp
  0 siblings, 0 replies; only message in thread
From: Donald Sharp @ 2018-02-17 12:47 UTC (permalink / raw)
  To: netdev

Newer kernels are now accepting a protocol from the installing
program for who installed the rule.  This change allows us
to see this change if it is being specified by the installing
program.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
---
 ip/iprule.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ip/iprule.c b/ip/iprule.c
index 82e22fee..5703d6e4 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -213,6 +213,9 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 	else if (frh->action != RTN_UNICAST)
 		fprintf(fp, "%s", rtnl_rtntype_n2a(frh->action, b1, sizeof(b1)));
 
+	if (frh->proto != RTPROT_UNSPEC)
+		fprintf(fp, " proto %s ",
+			rtnl_rtprot_n2a(frh->proto, b1, sizeof(b1)));
 	fprintf(fp, "\n");
 	fflush(fp);
 	return 0;
-- 
2.14.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-17 12:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-17 12:47 [PATCH 2/3] ip: Display ip rule protocol used Donald Sharp

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.