Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp23129lqc; Thu, 7 Mar 2024 09:13:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpNtuMWRN2t48Els3YuQI6n7xFj6DyoWg9lYKPF0S6jHfV7w6DwxDM0H78EPK13mPYXLnjZu7BIwwdXJTfHGhcDcUFNbnRN4X2m2dcCA== X-Google-Smtp-Source: AGHT+IFBa3kNAnJzt68+jvlTLN8abUA3qzqhwECraIomJGmZsJWBPzXgpEM+03fxzsR+4voSm/vp X-Received: by 2002:a05:6122:2522:b0:4ce:96b7:c2f6 with SMTP id cl34-20020a056122252200b004ce96b7c2f6mr1836765vkb.5.1709831586957; Thu, 07 Mar 2024 09:13:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709831586; cv=pass; d=google.com; s=arc-20160816; b=PDPTRZsAqfBDbZkippTfNg4XgwSwXiYzi4pf4ey8NYpLvp1UBStuzDmtr5PY4jNYDY LLq0J7t2VYX3nVSEj1rx78uSQEYIDw2R3rbI2EcSONcACGK6/4qpEcVaFNYSLZYO35AJ BAKRGI9n5Yvgfqu7trYsr+a5L4ZnL0V8ru0wBeWraOFfS8Rg2p2DB5H2bb8hOX+SRjYO AkjRuHRQN/NkIyMggSXMRVoVHeMhFlmJReZC7T3P206duOZzRih9GtY2k6rQ2j4eAME8 h69yqNrd3iNtIugrpkbzn6oOZg9GRsRgb5YpLxjCDx/ysaakOi6VTjOx1/KLXty1RdJ5 TyWg== 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=hP/JiZAWPxHAfkkPmvTb9IoKImN6811SzpISJpC/Dc0=; fh=8353CxfwDS1K9lF7tbHyGZr/tZw/L6yFsR71b9UfVUs=; b=0WOO9aZt1tE6k0YaA1yjl09ZPEemHLpAHHblZtIiGv4EzkgMRJaDWRNJ0uSMjpRmLC RB+M1POGLWUG29O+fvAWH8cA7VsOOyJPkED2VgkgQvfsGs8lVFMn6jb2tycPGFDYxOSU 2g4p3gZhp4o9LdR1AJDkf7jl6XYbuwJEwGTX6gY2+jxEISqHzGNePjBglIIXRKyX+7nh GxtkhciSNcd0akLVMZCEacISlfpDhB8/OuYiTT1FGTP/BcgcjerU1MjqYJPBXuQVaXO1 6wREP/chj1XV0ZPEpbOKxLfjm3tb3udmxVNKmpj8hOJSSGXvpu6CHbWrEWBWCCSa0Dhc nKLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="YFf/7R/D"; 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-95917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95917-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 f9-20020a9f32c9000000b007db1e50e9a0si1982984uac.189.2024.03.07.09.13.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 09:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95917-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="YFf/7R/D"; 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-95917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95917-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 A049A1C21A86 for ; Thu, 7 Mar 2024 17:13:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39676130AD0; Thu, 7 Mar 2024 17:12:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YFf/7R/D" 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 BCB121EB40; Thu, 7 Mar 2024 17:12:47 +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=1709831569; cv=none; b=fXGSDLZbXarnKwxtFjy0AE9QYOAQVUwk1HU2LeouwuU67DpZ5KYWsT1TsUaG4R4Y7G83c8oSU0yz1i0jagsRLPDlzX7Kj6TvHg+rEMhnxhY1Qv+xKIX3ZIG/GwfbvG1/RACpAkNa663E0Qu1RMFOZhSLEmS1JLYwNn9xGG6fyoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709831569; c=relaxed/simple; bh=i6hpcrLLCR46LG/IX6FqxmylW2weKfFyAGJ2GLuqwIc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T1MMeJn6TU2ffj4z5GFEuw3cFxyse75Ok0yGsvHnqd8exWdpSRgOmv+/7RAsEnK1jsqG2S+5jr9UAz7sppUtWfVia/8cYiUZAusTDayD1fWdeYgpnu3S4y9J/2rbBV1yd4YOMj+70mV30Eqvgdo4EyGGuSaW9RPOFU7RgL1ko2w= 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=YFf/7R/D; 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-2d26227d508so14794541fa.2; Thu, 07 Mar 2024 09:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709831565; x=1710436365; 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=hP/JiZAWPxHAfkkPmvTb9IoKImN6811SzpISJpC/Dc0=; b=YFf/7R/DyVXZAdHNQ28NUMQEptrr4ZhxLK4AscS+qJ5CP1NhRxn8s/Zt08pPWYF/kq HAZclgQEje27DY3TKsGaMRzVtJbmBk1NPr0BaLUDkSl/EkIyJYUnuLzFyTv7zfEuv9uO fpDGGE1tUekp1r+YuOt0hfYNuBy3FVfxZy83BwkwML4dYtNyNEmwXxWIghQ9MICpc/56 DS86BJqIDcvCphCKjoLHJIlXVEdDtn8Eye4UuR0hSjKuPhJmgyP3jhaHrLqFDNc4ptTJ 8QO3v5ls/UBO8KMJoxpd9wuiyMSeGmmKyx+i5IokPsz2WfC9+S21ZVN9lPij+U2Jt356 egSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709831565; x=1710436365; 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=hP/JiZAWPxHAfkkPmvTb9IoKImN6811SzpISJpC/Dc0=; b=PAzu544XXcUIX6axCdFJvcKiHWbkOhA9+JUmd6P2fSbGQdS4M30bNmP2WcsW6w4pjG XsAxLRkHL6v1NSZDvzrPzBrsNuOZZ3tZP30cKVW50JIDFIJqBsSl0v9KDIQdRolpPZdy oHMwtglnDUQgRaCBIPRPr1phREL5s8ATsBeDmtThMoB27arY/DXoyAVP7eQqDog6pgF1 DDFFZUJ+y3Fw7sQXSN3tzo6ys6vQ5YQwNASEQDT5qMpjvU9UT7Np9RDU6T2CN6vCAed8 x14yMvXwE1+W4O8/fusFTH2epe20VgnMO6gOXou355cSAgQ1x5v+Dt2I2Lt/KtIMEvXd KMPA== X-Forwarded-Encrypted: i=1; AJvYcCXwEeOelEaQncoxtfQa4/JSxbYN/0nZXE9+yuZAEEd6toaOHymAI2cr88rSnCqzDt697rU8KiSB/nEnNKh6b6n+cXav2IUWntAkoPfS X-Gm-Message-State: AOJu0YzUPuIQDKEP+/pQXk235DFM5r3GfLGXYyA1q8fhhcAq95lTyCNK AaqSKJDe6OiQg5pCj4hIxgDt7bkeUwHe7qU3oQA/gHJ9i/3eLe+Id/uR2OjGoYM= X-Received: by 2002:a05:6512:3b9d:b0:513:d2:ad11 with SMTP id g29-20020a0565123b9d00b0051300d2ad11mr2234940lfv.53.1709831565462; Thu, 07 Mar 2024 09:12:45 -0800 (PST) Received: from localhost ([45.130.85.5]) by smtp.gmail.com with ESMTPSA id l37-20020a05600c1d2500b0041315f221c7sm582707wms.16.2024.03.07.09.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 09:12:45 -0800 (PST) From: Leone Fernando To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org, willemb@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Leone Fernando Subject: [PATCH net-next 1/4] net: route: expire rt if the dst it holds is expired Date: Thu, 7 Mar 2024 18:11:59 +0100 Message-Id: <20240307171202.232684-2-leone4fernando@gmail.com> In-Reply-To: <20240307171202.232684-1-leone4fernando@gmail.com> References: <20240307171202.232684-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 c8f76f56dc16..73e742424e97 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -392,7 +392,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