From mboxrd@z Thu Jan 1 00:00:00 1970 From: Donald Sharp Subject: [PATCH 2/3] ip: Display ip rule protocol used Date: Sat, 17 Feb 2018 07:47:52 -0500 Message-ID: <20180217124753.2879-3-sharpd@cumulusnetworks.com> To: netdev@vger.kernel.org Return-path: Received: from mail-qt0-f195.google.com ([209.85.216.195]:35941 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbeBQMsK (ORCPT ); Sat, 17 Feb 2018 07:48:10 -0500 Received: by mail-qt0-f195.google.com with SMTP id q18so7070025qtl.3 for ; Sat, 17 Feb 2018 04:48:09 -0800 (PST) Received: from robot.nc.rr.com (cpe-2606-A000-111D-803E-4980-482B-47BB-96B9.dyn6.twc.com. [2606:a000:111d:803e:4980:482b:47bb:96b9]) by smtp.googlemail.com with ESMTPSA id v1sm1450827qtg.43.2018.02.17.04.48.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 04:48:08 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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