From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_MED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8580C46460 for ; Wed, 5 Jun 2019 01:48:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1992207E0 for ; Wed, 5 Jun 2019 01:48:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Q4nN0700" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726464AbfFEBsM (ORCPT ); Tue, 4 Jun 2019 21:48:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36559 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbfFEBsM (ORCPT ); Tue, 4 Jun 2019 21:48:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id n4so14713185wrs.3 for ; Tue, 04 Jun 2019 18:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mC3CDA6shFUOmBCHFjejmdHtm7lYYw24CWzxIEZRePA=; b=Q4nN0700H9Htikr/6YHW8F26d8P9JNdXrwOfOsleodxkBlaa8TBB9XI+FL3c+sFQC8 LfZATNOWfw5Rnyc0rwWC/bnCGyi9jiR+tPTXOHzM6jCQNf6yhSXKp672fbBByM2hV6Vw /bt5tXKXjvpYn6IxnBN3BzGnXHyqa4Z+ax3k65E9Li+Vou/K6vtqhxo+W2QvYbkeD+de xcqi4bk5siVxy+pHBZIabCHaCzWaLSy6dXNd07G1WFqaNLRyUKflG688sJsjduUBWToU APHlsFZ/L76o2Bn2xUyvpuXs3jkRyHlIYG5/wQYEOePgPKiN4zNLbSodsZDkhlVMUs4t /APA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mC3CDA6shFUOmBCHFjejmdHtm7lYYw24CWzxIEZRePA=; b=l7EU+JMtbnSDqhY6r2ZBsn/TI8nLIm7jpf4xksyNecu/THXHRDoA/lbsESuJ9AKilX yl7WD//hh16+Q14i9Ikv512SfTKdZjFoo8QZQi7ccro9EHJhf0bloFpOSncHyF8wbd7x DsYwoBnXKwUf5YHciwp1NoYFFkI4VS8GvCdzWWQOgGt0WCt/WvJBa/Dh4iKpRSMH/TnI Y/Ea5YDyxInULLbXssTe5jPQAI4jsZx+ekrOnriIyPgsRCpPicpC6IWMO/eWjEJerh8P eK/wBldnsUi90a/nEshhtvrhAsAIybi1EdAdCJrxD9QOdIT8CBgEZGRjUNWlXmaR7Xzx Gm4g== X-Gm-Message-State: APjAAAVn0/d4y1UG08EFw1YbGXl3+wa8ZSW1l8GZ62D1fFslOGsRt7iR OIQQXsGJdJOHuM5y9vHLWhHPPX5fAULUxDjILxIbdA== X-Google-Smtp-Source: APXvYqxDvr4svxDl9eUvnm3pZN3ybktIvbQ5QKri/mRAdNiHcdRzVoNgNa9iUygXnfphswnNwo9SLJIxwqxUyJ3YemY= X-Received: by 2002:a5d:4d84:: with SMTP id b4mr8751169wru.102.1559699290251; Tue, 04 Jun 2019 18:48:10 -0700 (PDT) MIME-Version: 1.0 References: <20190507091118.24324-1-liuhangbin@gmail.com> <20190508.093541.1274244477886053907.davem@davemloft.net> <20190605014344.GY18865@dhcp-12-139.nay.redhat.com> In-Reply-To: <20190605014344.GY18865@dhcp-12-139.nay.redhat.com> From: Lorenzo Colitti Date: Wed, 5 Jun 2019 10:47:58 +0900 Message-ID: Subject: Re: [PATCH net] fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied To: Hangbin Liu Cc: David Ahern , David Miller , Yaro Slav , Thomas Haller , Alistair Strachan , Greg KH , Linux NetDev , Mateusz Bajorski , David Ahern , =?UTF-8?Q?Maciej_=C5=BBenczykowski?= Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jun 5, 2019 at 10:43 AM Hangbin Liu wrote: > Although I'm still not clear what's the difference between > > a) adding a dup rule and remove it later > and > b) return 0 directly if the rule exactally the same. The Android code updates ip rules by adding the new rule and then deleting the old rule. Before this patch, the result of the operation is that the old rule is deleted and the new rule exists. After this patch, if the new rule is the same as the old rule, then the add does nothing and the delete deletes the old rule. The result of the operation is that the old rule is deleted and the new rule is no longer there, and the rules are broken.