From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f196.google.com ([209.85.216.196]:46412 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbeBUBx6 (ORCPT ); Tue, 20 Feb 2018 20:53:58 -0500 Received: by mail-qt0-f196.google.com with SMTP id u6so116177qtg.13 for ; Tue, 20 Feb 2018 17:53:58 -0800 (PST) From: Donald Sharp To: netdev@vger.kernel.org, dsahern@gmail.com Subject: [PATCH iproute2-next 2/4] ip: Display ip rule protocol used Date: Tue, 20 Feb 2018 20:53:46 -0500 Message-Id: <20180221015348.32646-3-sharpd@cumulusnetworks.com> 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ip/iprule.c b/ip/iprule.c index c40d76f1..b3e7d92c 100644 --- a/ip/iprule.c +++ b/ip/iprule.c @@ -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; -- 2.14.3