From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:43581 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751642AbeCHSO0 (ORCPT ); Thu, 8 Mar 2018 13:14:26 -0500 Received: by mail-pg0-f67.google.com with SMTP id e9so2518384pgs.10 for ; Thu, 08 Mar 2018 10:14:26 -0800 (PST) Subject: Re: [PATCH iproute2 net-next v5] iprule: support for ip_proto, sport and dport match options To: Roopa Prabhu Cc: netdev@vger.kernel.org References: <1520532407-22966-1-git-send-email-roopa@cumulusnetworks.com> From: David Ahern Message-ID: <439a2ed6-a242-e0a9-1a8a-a8a86d2665e0@gmail.com> Date: Thu, 8 Mar 2018 11:14:23 -0700 MIME-Version: 1.0 In-Reply-To: <1520532407-22966-1-git-send-email-roopa@cumulusnetworks.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 3/8/18 11:06 AM, Roopa Prabhu wrote: > From: Roopa Prabhu > > 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 > --- > 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