Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2402834ybi; Mon, 1 Jul 2019 11:23:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvRTqyMsui6+hEDSj1d0xGHGz6XT0aNcFfP1cZ8AyRL5jcHcYgpXOtJd8UMHLOHiT1krqG X-Received: by 2002:a17:90a:384d:: with SMTP id l13mr736016pjf.86.1562005421840; Mon, 01 Jul 2019 11:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562005421; cv=none; d=google.com; s=arc-20160816; b=tT7FD9b/mVR6Iudz+pZyILFD1QP897W9vJPTmnd5Fd3J+9sE5Y1VApCXzxcsMjXzLR 8we7toLrq6n/ljUPidhJ22kGKF3KKDKEx/aioA1WjamI5mufSqtQA+cVyal1oQbNLSeL VFHp9+LpdLWJlDOI6IPE29RgNSGvODeZE/Y6MXJHd8QDRaUCsD1p3wl7UrpKi7ZQrFjY e1ubTvPoCUUYbRVlO8M4PYL/dK2XP9/hwRT5rxrMx9rzVFY6fL3OcSfL7ZmnCWmWhRsP WIHHn+3IAxZbDJdTgMASX7a1JTCY4gFYFrnzW0tCtTtGLw7cekabmGdmFXT3REP20MdS 0tgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=plGEnnkHTwbFnqrwsQDyrxK5zcXlxJ0xq6d+DbYqxnQ=; b=R195C0DymGYTUOM2yrgvgwV7W7Hek8TKjRYNwtixtzWcc/IqVyyHfrNe8x05To2wxl 7rkQbhqCUTlF/RrM7nvIstWb6X/XDdp8Edyr8uF0hqj9TW+R0E80UfSxlZcSLTvsNkSy IHsEttvUB0jPzyQTAW6ws7t7zrhwWAS/FVd6e9RdK11cLhUO6fowEb/v9JipXnwmu/Y8 dsvlQ4yX8bNmG0rJwd/t3bcjSqUcYWUeeHlWaal7oQESeaQjM8IWecW8+kd55CP/AVX8 9Fu0Eiywgp/HeLNHoAMF6A9xLuNsGhT5A5XLVLmwyIb8t7a+Hsf1jCutvnqGguA7O1Oq rDdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si183687pjr.68.2019.07.01.11.23.27; Mon, 01 Jul 2019 11:23:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726966AbfGASB5 (ORCPT + 99 others); Mon, 1 Jul 2019 14:01:57 -0400 Received: from mail.us.es ([193.147.175.20]:45080 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbfGASB5 (ORCPT ); Mon, 1 Jul 2019 14:01:57 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id A24D811F021 for ; Mon, 1 Jul 2019 20:01:55 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 8DE2FDA3F4 for ; Mon, 1 Jul 2019 20:01:55 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 82E15DA801; Mon, 1 Jul 2019 20:01:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 7C068DA704; Mon, 1 Jul 2019 20:01:53 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Mon, 01 Jul 2019 20:01:53 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 414634265A2F; Mon, 1 Jul 2019 20:01:53 +0200 (CEST) Date: Mon, 1 Jul 2019 20:01:52 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: linmiaohe Cc: David Ahern , "kadlec@blackhole.kfki.hu" , "fw@strlen.de" , "davem@davemloft.net" , "kuznet@ms2.inr.ac.ru" , "yoshfuji@linux-ipv6.org" , "netfilter-devel@vger.kernel.org" , "coreteam@netfilter.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Mingfangsen Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0ggdjRdIG5l?= =?utf-8?Q?t=3A?= netfilter: Fix rpfilter dropping vrf packets by mistake Message-ID: <20190701180152.65ajqxmht56dxmxi@salvia> References: <2213b3e722a14ee48768ecc7118efc46@huawei.com> <08740476-acfb-d35a-50b7-3aee42f23bfa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 29, 2019 at 02:13:59PM +0000, linmiaohe wrote: > On 6/29/19 20:20 PM, David Ahern wrote: > > On 6/28/19 8:13 PM, linmiaohe wrote: > > > You're right. Fib rules code would set FLOWI_FLAG_SKIP_NH_OIF flag. > > > But I set it here for distinguish with the flags & XT_RPFILTER_LOOSE > > > branch. Without this, they do the same work and maybe should be > > > combined. I don't want to do that as that makes code confusing. > > > Is this code snipet below ok ? If so, I would delete this flag setting. > > > > > > } else if (netif_is_l3_master(dev) || netif_is_l3_slave(dev)) { > > > fl6.flowi6_oif = dev->ifindex; > > > } else if ((flags & XT_RPFILTER_LOOSE) == 0) > > > fl6.flowi6_oif = dev->ifindex; > > > that looks fine to me, but it is up to Pablo. > > @David Ahern Many thanks for your valuable advice. > > @ Pablo Hi, could you please tell me if this code snipet is ok? > If not, which code would you prefer? It's very nice of you to > figure it out for me. Thanks a lot. Probably this? } else if (netif_is_l3_master(dev) || netif_is_l3_slave(dev) || (flags & XT_RPFILTER_LOOSE) == 0) { fl6.flowi6_oif = dev->ifindex; } Thanks.