* [PATCH iproute2-next 3/4] ip: Allow rules to accept a specified protocol
@ 2018-02-21 1:53 Donald Sharp
0 siblings, 0 replies; only message in thread
From: Donald Sharp @ 2018-02-21 1:53 UTC (permalink / raw)
To: netdev, dsahern
Allow the specification of a protocol when the user
adds/modifies/deletes a rule.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
---
ip/iprule.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ip/iprule.c b/ip/iprule.c
index b3e7d92c..fd242fee 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -675,6 +675,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);
+ req.frh.proto = proto;
} else if (matches(*argv, "table") == 0 ||
strcmp(*argv, "lookup") == 0) {
NEXT_ARG();
--
2.14.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-21 1:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-21 1:53 [PATCH iproute2-next 3/4] ip: Allow rules to accept a specified protocol Donald Sharp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).