Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp488621lqh; Tue, 7 May 2024 05:44:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsy4HdU7X45M996vmwpu4BbKUJ3/DrabNxwjm1gI9kw3TF7+ac1N1VF9XgHiRhtvFGjOJfG8gnl8Z16BYb6YTT4M8jw9a5KG67Oa+w1g== X-Google-Smtp-Source: AGHT+IGIqeVQ+93aQvXh1Vci0JV/tOrixABk5nynDJNsRc0wWukrNVRQvUKBEc42UbCosftVSmG5 X-Received: by 2002:a05:620a:55a7:b0:792:9308:42b2 with SMTP id vr7-20020a05620a55a700b00792930842b2mr7216182qkn.78.1715085839994; Tue, 07 May 2024 05:43:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715085839; cv=pass; d=google.com; s=arc-20160816; b=GLvj7V2ixL68PVvqU94tfCFYBK58riEhm534TIcIwncQe6rCOaOFd+1C+e5+I8PC0m tjmdVsy58b75TPC5ZRBDKsJ4MFT29tfsOW67vSnPcfOEUeSbqQqmt4QaSr8b4/XXB9Ho bsfAsmdMV9Zg9amPN1i6Jqre/i7DndxzfHuQzthH3TV7ivecxgxwn5gu7It/Wfx7Soqy pwb2MTzDEjDi1EFHU9gDUyFxtADlCM5e96SzjP9b00yXvdTDSnVwWnONsgWcKVPSglYr w0LMBNQ5p4QpiK83silH39sKElzTAaPqKeZskKLOzxdHsxorUYqB31g6RYRo+11muCTj Dryw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=N8GyKjDI+jVJzoUqihNVdIo6Wq2mpBnHDTxCj86/HJU=; fh=B4sP5D8Jn/UbJWDkw5UAlCLjysSsdoU+g0Sz8zBGZVc=; b=SzqDxEFIuynzzddI4RbiaXpYhYIFiyW7Z1VGofiS6GBTcsQHBGrqNlxhcElVCx5t6E mtNZnJWi+x3s0POrDh1QgSQJus3/NIWv/k9Z9LWYm1iqvmudu7xK2o7VylJFrLnyXCtb hNyJyhR8ugfbEiUMEBjnmHPwkuNG7Vxg5yOZIEtIHEs/fs+CpfBXrcpm73meQNipOOMz Ss4btzgO/oruRWDV+MBvfzfaUpzgKxKUNZtoVcgqsZKcRgww06xFe5hTPYtgjrZPB3Zc pthB2XrWyYf+mC+r/U7oc2+obP3NnQHNKF9/HKDildiOWCA55SnK+c8UreKNDWt4Mbrc icHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BWjsXC49; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-171302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171302-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wx1-20020a05620a5a4100b00792996349e7si4345606qkn.705.2024.05.07.05.43.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 05:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BWjsXC49; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-171302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171302-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B5EF31C20B80 for ; Tue, 7 May 2024 12:43:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 321E915B149; Tue, 7 May 2024 12:43:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BWjsXC49" Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1A5E6CDB1; Tue, 7 May 2024 12:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715085832; cv=none; b=oPu9J7XrET+aHkR85gVwNtZ2pRQ9QKeM8yjnAo9hV52LEyjse6ucM7XKTrCd6+e5LbBrruSkhiYoOYmSewiaQu1Mc6APOV5TfK+nIvXarJtFniJ95nUn2Q+w6bHKWPbKr8qpXkzwBQOXlmqJPrKvfr0uyxQd1CBr/RFTudID/JE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715085832; c=relaxed/simple; bh=Fdw3Uq6FEPRXufspQMbgG3TS8Lw8taqj/1zCK6girO8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RNo345F7dW3X0IPDpfXLoD9COpCMqnw/eGSKaMnKXWblGQIkfgQ8L/F6+D8Gzzz3KoK1PaFyuKWQsLRO44vWiC+AGgwCY5d0xItVKI/wWfNcNUq5z5DUGoQAnXLwYXYxwhUjw7xWYN87Pr3C6c78pKsDe/8L2wmFINyd3MEWqfg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BWjsXC49; arc=none smtp.client-ip=209.85.208.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f196.google.com with SMTP id 38308e7fff4ca-2e242b1df60so37348921fa.1; Tue, 07 May 2024 05:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715085829; x=1715690629; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N8GyKjDI+jVJzoUqihNVdIo6Wq2mpBnHDTxCj86/HJU=; b=BWjsXC49kuNvJiiE1c5BPKNckopzi9aW8nibdwhzN5x4i+VZz2t2ZZky2hMPXgkQyi PIK+UGL/W+2F9HKPXerAAW1hhgycsN70UgEJmoyJ90pLvNq678KGipT4cAm8cqwuKw4Q bXWs6Cliix1k033utyibEv65bYZVwWBFxDnzSe0/je9p3avnoYY9OxScAtucfDOZtF7A bgENjft3RajX68x4g7MOKZxboRGDaH+6QNjw13GVn3/3c19sIs9/MAZF7gt3WIWdD27g 9kHKGYIpeEmPFgG7KH1R9JVhqfLqfAyko4yg21Rl15UCB7ZSo6ui+1t9wZz5UNG6KWUG sqlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715085829; x=1715690629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N8GyKjDI+jVJzoUqihNVdIo6Wq2mpBnHDTxCj86/HJU=; b=AWjr8YSM+mteuocwTBgm7XEvz9MBqGvZCkzzCE85tc5Fu6NMTRvDDNsYMYDpp+QRCz EvZWA7lA7ff7vjteeiWssriAWNenBAbguIFJeUCaxidmtt7SJGf0YUYnlXjWKHZOgYCR 5S3ID565VJ2vA7JuHV0LR0Wl1XMi7jFUkJNtH9JL+7nCtLTKnB1j1o7T78bNlD/2a8sY K1JyAcTmn2mxllv6stK60fNacgmO/wZS98dWdM7nmN/gUhEiqacjoPmnN1fLH7KmCEEO 7VPlRBcypzPHO0ep3pMyPCYKnk+vMWLSSFYYrHlqCNwO4BPNNe0OdTlsXCG9S9+i0d5S 3P+A== X-Forwarded-Encrypted: i=1; AJvYcCUQ3h0Et+cIo8fPdQDsxbWCGzsOfYpTHwa6mNrxXg1AIfWeTClpPpfnO+ZqpePpT70jFnPl+5e8wqZhd0ogVJykA2M1wCTywT08jwMwsgw5aR+HG/3iT5Im76zAcvgFfpSs8uLs X-Gm-Message-State: AOJu0YxBwEBL1Xncp2m8ZHSJVzTjDJnIXZHty+mtKYSkdtYZ7ZPJekkY HiVx/b9v/5DmQRAbCLFfXHweqaLW0O9UKonqGmAEGwBb6Vt3aTLN X-Received: by 2002:a2e:a6a1:0:b0:2df:faf0:c5e4 with SMTP id q33-20020a2ea6a1000000b002dffaf0c5e4mr11218713lje.23.1715085828649; Tue, 07 May 2024 05:43:48 -0700 (PDT) Received: from localhost ([45.130.85.2]) by smtp.gmail.com with ESMTPSA id j13-20020a05600c1c0d00b0041be58cdf83sm19555059wms.4.2024.05.07.05.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 05:43:48 -0700 (PDT) From: Leone Fernando To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org, willemb@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leone Fernando Subject: [PATCH net-next v2 1/4] net: route: expire rt if the dst it holds is expired Date: Tue, 7 May 2024 14:42:26 +0200 Message-Id: <20240507124229.446802-2-leone4fernando@gmail.com> In-Reply-To: <20240507124229.446802-1-leone4fernando@gmail.com> References: <20240507124229.446802-1-leone4fernando@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The function rt_is_expired is used to verify that a cached dst is valid. Currently, this function ignores the rt.dst->expires value. Add a check to rt_is_expired that validates that the dst is not expired. Signed-off-by: Leone Fernando --- net/ipv4/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5fd54103174f..4e6b7a67f177 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -389,7 +389,8 @@ static inline int ip_rt_proc_init(void) static inline bool rt_is_expired(const struct rtable *rth) { - return rth->rt_genid != rt_genid_ipv4(dev_net(rth->dst.dev)); + return rth->rt_genid != rt_genid_ipv4(dev_net(rth->dst.dev)) || + (rth->dst.expires && time_after(jiffies, rth->dst.expires)); } void rt_cache_flush(struct net *net) -- 2.34.1