From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f194.google.com ([209.85.216.194]:43800 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754689AbeBWTc7 (ORCPT ); Fri, 23 Feb 2018 14:32:59 -0500 Received: by mail-qt0-f194.google.com with SMTP id d26so11865445qtk.10 for ; Fri, 23 Feb 2018 11:32:59 -0800 (PST) From: Donald Sharp To: netdev@vger.kernel.org, dsahern@gmail.com Subject: [PATCH v3 iproute2-next 3/3] ip: Allow rules to accept a specified protocol Date: Fri, 23 Feb 2018 14:32:48 -0500 Message-Id: <20180223193248.16744-4-sharpd@cumulusnetworks.com> In-Reply-To: <20180221015348.32646-1-sharpd@cumulusnetworks.com> References: <20180221015348.32646-1-sharpd@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: Allow the specification of a protocol when the user adds/modifies/deletes a rule. Signed-off-by: Donald Sharp --- ip/iprule.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ip/iprule.c b/ip/iprule.c index 17df9e9b..796da3b3 100644 --- a/ip/iprule.c +++ b/ip/iprule.c @@ -689,6 +689,12 @@ static int iprule_modify(int cmd, int argc, char **argv) if (get_rt_realms_or_raw(&realm, *argv)) invarg("invalid realms\n", *argv); addattr32(&req.n, sizeof(req), FRA_FLOW, realm); + } else if (matches(*argv, "protocol") == 0) { + __u32 proto; + NEXT_ARG(); + if (rtnl_rtprot_a2n(&proto, *argv)) + invarg("\"protocol\" value is invalid\n", *argv); + addattr8(&req.n, sizeof(req), FRA_PROTOCOL, proto); } else if (matches(*argv, "table") == 0 || strcmp(*argv, "lookup") == 0) { NEXT_ARG(); -- 2.14.3