Skip to contentSkip to conversation

ip: Display ip rule protocol used

PATCH Superseded Donald Sharp 1 participant 1 message Feb 21, 2018

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 ip: Display ip rule protocol used

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.

---
 ip/iprule.c | 4 ++++
 1 file changed, 4 insertions(+)
ip/iprule.c +4 -0
index c40d76f1..b3e7d92c 100644
@@ -341,6 +341,10 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			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;
Signature · 1 line
2.14.3