From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net] net: fib_rules: add protocol check in rule_find Date: Thu, 28 Jun 2018 09:26:39 -0600 Message-ID: References: <1530149236-5144-1-git-send-email-roopa@cumulusnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Roopa Prabhu , davem@davemloft.net Return-path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:33199 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752451AbeF1P0n (ORCPT ); Thu, 28 Jun 2018 11:26:43 -0400 Received: by mail-pl0-f67.google.com with SMTP id 6-v6so2947403plb.0 for ; Thu, 28 Jun 2018 08:26:42 -0700 (PDT) In-Reply-To: <1530149236-5144-1-git-send-email-roopa@cumulusnetworks.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 6/27/18 7:27 PM, Roopa Prabhu wrote: > From: Roopa Prabhu > > After commit f9d4b0c1e969 ("fib_rules: move common handling of newrule > delrule msgs into fib_nl2rule"), rule_find is strict about checking > for an existing rule. rule_find must check against all > user given attributes, else it may match against a subset > of attributes and return an existing rule. > > In the below case, without support for protocol match, rule_find > will match only against 'table main' and return an existing rule. > > $ip -4 rule add table main protocol boot > RTNETLINK answers: File exists > > This patch adds protocol support to rule_find, forcing it to > check protocol match if given by the user. > > Fixes: f9d4b0c1e969 ("fib_rules: move common handling of newrule delrule msgs into fib_nl2rule") > Signed-off-by: Roopa Prabhu > --- Reviewed-by: David Ahern