Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp106372lqc; Thu, 7 Mar 2024 11:37:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXC/gxLpGAt5CyVkCqhhtUBQSp8G4GDRf2eyoqOgNwnoL4vvz4BHvvRJXYuF/SIvQ+ZKu24j0OHLh/uleXHLkjF91E177YPqx028A9bCw== X-Google-Smtp-Source: AGHT+IEp4Bkh38wdNOfFap8Ihq4ScedjsoztlH2dQBi8I4JVbz4bWaSxieIoThnZOYCILG5QMUqv X-Received: by 2002:a17:90a:520d:b0:29b:8ac4:c55e with SMTP id v13-20020a17090a520d00b0029b8ac4c55emr3074688pjh.0.1709840225205; Thu, 07 Mar 2024 11:37:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709840225; cv=pass; d=google.com; s=arc-20160816; b=bJSYQdu/nnPMYo2TGLFNxHvOzfPCmOEtZisDNM1T+22CBzQOHNDyQF0D5oCem+YAcN 9PMjPAsEYwIBWpaBYegHQJ8ar+YgtmOlaxQwX8j8HYa4plkF8QAK+Yhw+jesUTeHi5AE lcMIrd3I12k3g8eTnXn5V+PXQI/X0bHAqhwKooa+rW6b7sFqkGdtFeTKKAD94lcrNS0d WHyxTtnAkBoSGHnE5WNu3nHlRIyNFHX/oQS2u9Bw1UDGFJAvS/LsK/RPcCRY9nSADKKh uBs7bOgFB9mmWAPRKwcwpvq/cTmyhn5TFbSpuhugKV3+spsycCEykcDLujw401vTBsgS jbkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=X1Yi8Lul6QA6rcz7CJHDcWwyDzCRrwEaGvAx9zjPbBI=; fh=flhwNxXtdT8QUb8ZEmM5noLB+EZxHiYOnIsgLOH4Ok8=; b=YCqt0VE0bqvENUo96rGyc15CLd1+zw7LBYgtfUGjORtK4dzeTQ5u/8TSHrY3vi4sSB huDBhglDNRvmtLkxHfJZy8AfTpb+8KzradcHyR0wY3VLp7Rwzr8MRK9PaYpqjV7WZFyJ lxehaJQ+iQGpwqUNpmZw9ixUg96+47HttmtwNNHWArfZlnIbMdw0Aq8KGrvH6QwtcW7N OG/t93Ku6YaB+WLAPV3FECAGJjqpSoZ6qL0zUh4A+snYN1zGLm3FtPW/kN/rvICVt21S QXMWaDd5iwgY41H2TnFc3eW8Pc6jJPJKQSl/9wMLy+TTtCDTiUtSYnQMRQcG3Ml2rVEp t+Fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tOA5lQQA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96117-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z9-20020a17090acb0900b0029b9753772bsi1304778pjt.68.2024.03.07.11.37.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:37:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96117-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tOA5lQQA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96117-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CE55228833A for ; Thu, 7 Mar 2024 19:37:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD4FF137922; Thu, 7 Mar 2024 19:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tOA5lQQA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C81EF135A56; Thu, 7 Mar 2024 19:36:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709840215; cv=none; b=WuK7hxmoXh6ye7GAkAHbL9fm6TxW3WM3fdn3QBjvMxPrI+D4M9TAc2XmlNqZvxqYXWZnFzBuWabclwkUjjhYqEc/zOW2Gx/BrFTHzyw6k1od+/Iu2OOSf0cyfGnK+nPtWP59zVSJHA8erl/Abx6u2luLSREQTEdjbW59z/hEqR8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709840215; c=relaxed/simple; bh=1KgGaAOEWbovalkj+qhFZ1YtOmYOmUKmUqLvlOtisHQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=r1AoJp9tSiOKbvdeMDq9VY7qeGCiWJspkjjyZrLZDGx7GT1XULfFxXa+qAvAcAzJJZkvvnLlNFkhxsINRGbyaiGcFf/Ty5lI5D00JPab78dzT8weKNlwyLSdI6roElnlqLN+aIgxo1ftEwxitUngOqwg0RjNiSjLNWqWTf2kCRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tOA5lQQA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF3F2C433F1; Thu, 7 Mar 2024 19:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709840215; bh=1KgGaAOEWbovalkj+qhFZ1YtOmYOmUKmUqLvlOtisHQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=tOA5lQQAX0B3LhpjtoXKJRjGQ85CeIUnjIZ0wkJcN5D+SORITfOESXruD0j0BFK/E 0UKY9dgzyyXDFzMgO8Px+GltHCeGcnat3LXBWdjEoetCR4/yG4rNPwQr4QhN1pvkfw E3eHtLIlMHsJjwiwSjPVoO/UWqK1XN3oTD9xmJBjpxywjZocsZgd8uh+9yxFImk532 bCNIQevs5HSINTFzWTo76AegUv9XbnEgBo1qitZJsAjpDqEheNrzKURhWUX36P6x2t 9TZX3kCp85qoFhPhZtsGH+vT/1YFk/37Pd2qdLZ6aPLRejdf3M3usNwAEM/naXI2YQ ke5B1CuE3sIww== Message-ID: <5487d52a-31de-4422-b5ed-a59390d23ca0@kernel.org> Date: Thu, 7 Mar 2024 12:36:53 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v5] ipv6: fib6_rules: flush route cache when rule is changed Content-Language: en-US To: Shiming Cheng , jiri@resnulli.us, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Lena Wang References: <20240307100157.29699-1-shiming.cheng@mediatek.com> From: David Ahern In-Reply-To: <20240307100157.29699-1-shiming.cheng@mediatek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/7/24 3:01 AM, Shiming Cheng wrote: > When rule policy is changed, ipv6 socket cache is not refreshed. > The sock's skb still uses a outdated route cache and was sent to > a wrong interface. > > To avoid this error we should update fib node's version when > rule is changed. Then skb's route will be reroute checked as > route cache version is already different with fib node version. > The route cache is refreshed to match the latest rule. > > Fixes: 101367c2f8c4 ("[IPV6]: Policy Routing Rules") > Signed-off-by: Shiming Cheng > Signed-off-by: Lena Wang > --- > v5: > - rebase on the top of latest net/main branch. > v4: > - add "Fixes:" tag. > - update subject as requested. > v3: > - update patch description and name format in commit message. > v2: > - modify flush function same way as ipv4 flush cache. > - use tabs to aligh with existing code. > --- > --- > net/ipv6/fib6_rules.c | 6 ++++++ > 1 file changed, 6 insertions(+) > Reviewed-by: David Ahern