Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1873016pxk; Tue, 1 Sep 2020 09:43:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL9kVBqSx1IhqDPUN7aVllFOFE/2lJy/7ym0cTV5CCaO9Cadx8M/Ib+VD4ktozAH56pOPe X-Received: by 2002:a17:906:bc98:: with SMTP id lv24mr2389002ejb.411.1598978606592; Tue, 01 Sep 2020 09:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598978606; cv=none; d=google.com; s=arc-20160816; b=QWD5ohvjXPns8E3HMMacabjTehx+sGlGLydvIKHpaR24mN8EVPtz8CG/p7lG1nkNjp ViPvLbN4oxa+i2cTRNNpnIKcAZJDF0MQRtGdjSZZ+Or4N6xQotEZwOjAJiNS+6LPvHdm caElMnaCEhNOMGvBDp2o32NU2juAiTX4U3agBU/BHQ+yIdAtRsF7vA2NRMGRGnu3PUOd Tdw3I+6Y9MPVPB6lpwCtl0EthNO4PODcUkF4So2BGrTKhUQGGGXvdIbkX1jo6c4y8kav T0mU2eYCR40w27O2YSXbjwfnJ8pb+Hi1+uH6wSwDZBwwphZNT1yitwCWZoIB4a6SEVLm +57w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2hmchj6tzXfg/rA+qGoMbvWLJHRk3QcZpqMSJbpmE5M=; b=gZxMKcwpIUfTE86wAQVBP9Yzya5gDa76pVYcVc5VjVFI2ESpYsRoDt13QMocDEM2uK 8ZZUsC5zMZsoDTYzJC/FtjWJ3Pukx5aCdOxD9+Zn/Lf0STHWm0snW4GUYHkFgjg2twG/ FedWC0XKDSK8CJ/l9DQa8Rc2zWHysm8yqxqISFG5z1rZ56o3js3iAbzJksywVOGGcH7G kehH3pKh2o5Yz6oB1yS2jXIjftcEIadQ1CZ8XLw58Zn2kYZmoqyVNPPDdLvdW8mW7KuL Q4C1fd7lYwXMIjHq0E8Cyu7O1ZygUz+CdEZLt1yAzY2XTNnggSqhzYiJs7RXYB4yCdET vVDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rC20qu2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yc29si848399ejb.674.2020.09.01.09.43.02; Tue, 01 Sep 2020 09:43:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rC20qu2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730773AbgIAQjv (ORCPT + 99 others); Tue, 1 Sep 2020 12:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbgIAQjf (ORCPT ); Tue, 1 Sep 2020 12:39:35 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69BCFC061244; Tue, 1 Sep 2020 09:39:35 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id r9so1965810ioa.2; Tue, 01 Sep 2020 09:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2hmchj6tzXfg/rA+qGoMbvWLJHRk3QcZpqMSJbpmE5M=; b=rC20qu2un7Z7QQjZU4xpUIIFoMOtynZFb53IprMdBjFF7A5Dwfp3urzo1m/pjQbQ+z xV0/pk4n2y2llclgMQV7U3eH48DulGc6n0YwaHiC0yF4PIld8gghCWWMpbRyeqnHdZ3q Xrsn9GZ7EH5jEgFh8RP0ZDLhayD/LWW4e9OmyPWwZf56veUki6rL+87wOZRH7p3mGD4f nkueltpv2+h8HhCJ9wroTxHTRIEuH3CnjsIhH4Au8LKK9BuNPkGKIXD8qOIKlx1gcKRC JB6o1Hxjw2KuxruwhGfL/gOgv7KLWP6FuHStxzo0lmFLRhQ7pDQIYylxUH18rW2fAEie twhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2hmchj6tzXfg/rA+qGoMbvWLJHRk3QcZpqMSJbpmE5M=; b=grpqVDEeQL7Oo0Csn7YU46hIg0vQmchtmJEqJUbs/DMeh8zGzjjb+b14krPJg1a44o m4W+9yUbzAxgnQ2KXddY7gyKieJUmFLYKh7SFj8H+nv25O5bf5O0QG7bksddmEZ6lCcE pwHGujOYENmiX99qX82Oufy9wtikC3VDAkfNHC/tUyylfWaD0jRcbRi+7dbRrnKDelX4 mrcSCwFY75jywU2R5SLf6cbd6tiqVslDcgu+2kh3vY+/buO2SUBMIMML7s0OVzujL+1b LdKSoW1em3ss1XlVt0PHbAVbdmcsqDdktr0z1hpwR57r2E0a5hyzCoXxQgIPmrL0vGLi gQdg== X-Gm-Message-State: AOAM532WbdX1eXseSWTfER4zktUT2Nk2Fa/88uZoC403lY3cQkk9ncI3 sYw1uXMtVhMh4Hw4uS8EtI1nJDhORasUwg== X-Received: by 2002:a05:6602:2d55:: with SMTP id d21mr2151921iow.134.1598978374614; Tue, 01 Sep 2020 09:39:34 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([2601:282:803:7700:883e:eb9e:60a1:7cfb]) by smtp.googlemail.com with ESMTPSA id r9sm815669iln.18.2020.09.01.09.39.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Sep 2020 09:39:33 -0700 (PDT) Subject: Re: [PATCH] net: ipv6: fix __rt6_purge_dflt_routers when forwarding is not set on all ifaces To: Brian Vazquez Cc: Eric Dumazet , Brian Vazquez , "David S . Miller" , LKML , netdev , David Ahern References: <20200901065758.1141786-1-brianvv@google.com> <52832405-fa37-38fb-b8fb-d7bd7a0d1d52@gmail.com> From: David Ahern Message-ID: <267ab500-18e3-d870-343e-499d0e96f989@gmail.com> Date: Tue, 1 Sep 2020 10:39:31 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/1/20 9:50 AM, Brian Vazquez wrote: > Hey David, > > On Tue, Sep 1, 2020 at 7:57 AM David Ahern wrote: >> >> On 9/1/20 1:56 AM, Eric Dumazet wrote: >>> On Tue, Sep 1, 2020 at 8:58 AM Brian Vazquez wrote: >>>> >>>> The problem is exposed when the system has multiple ifaces and >>>> forwarding is enabled on a subset of them, __rt6_purge_dflt_routers will >>>> clean the default route on all the ifaces which is not desired. >>>> >>>> This patches fixes that by cleaning only the routes where the iface has >>>> forwarding enabled. >>>> >>>> Fixes: z ("net: ipv6: Fix processing of RAs in presence of VRF") >> >> are you sure that is a Fixes tag for this problem? looking at that >> change it only handles RA for tables beyond the main table; it does not >> change the logic of how many or which routes are purged. > > That commit also added RT6_TABLE_HAS_DFLT_ROUTER so I thought that was > the commit needed to be mentioned. But probably it shouldn't? nah. That flag was added as an optimization. The patch referenced earlier changed the code from looking at one table to looking at all of them. The flag indicates which table have an RA based default route to avoid unnecessary walks. You could probably change it to a counter to handle the case of multiple default route entries. > Also Am I missing something or this is only called on on the sysctl path? It is only called when accept_ra sysctl is enabled as I recall. That setting requires forwarding to be disabled or overridden. See Documentation/networking/ip-sysctl.rst. It should be fairly easy to create a selftest using radvd and network namespaces.