On 3/8/18 11:06 AM, Roopa Prabhu wrote: > From: Roopa Prabhu <[email protected]> > > add support to match on ip_proto, sport and dport ranges. > For ip_proto, this patch currently enumerates, tcp, udp and sctp. > This list can be extended in the future. > > example: > $ip rule add sport 666-777 dport 999 ip_proto tcp table 100 > $ip rule show > 0: from all lookup local > 32765: from all ip_proto 6 sport 666-777 dport 999 lookup 100 > 32766: from all lookup main > 32767: from all lookup default > > Signed-off-by: Roopa Prabhu <[email protected]> > --- > v2: use inet_proto_* as suggested by David Ahern > > v3: fix newlines in usage (feedback from David Ahern) > > v4: fixes for json (feedback from Stephen H). > > v5: drop uapi header update from patch, use int for inet_proto_a2n > return val to catch invalid proto errors, rename ip_proto to ipproto > to be consistent with tc > > ip/iprule.c | 67 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > man/man8/ip-rule.8 | 32 +++++++++++++++++++++++++- > 2 files changed, 98 insertions(+), 1 deletion(-) >
applied to iproute2-next
