From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 678A8C282C4 for ; Sat, 9 Feb 2019 05:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F26820863 for ; Sat, 9 Feb 2019 05:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726268AbfBIFu4 (ORCPT ); Sat, 9 Feb 2019 00:50:56 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:41054 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbfBIFuz (ORCPT ); Sat, 9 Feb 2019 00:50:55 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 267AC149D8724; Fri, 8 Feb 2019 21:50:55 -0800 (PST) Date: Fri, 08 Feb 2019 21:50:51 -0800 (PST) Message-Id: <20190208.215051.440208661269017795.davem@davemloft.net> To: lorenzo.bianconi@redhat.com Cc: netdev@vger.kernel.org Subject: Re: [PATCH net] net: ipv4: use a dedicated counter for icmp_v4 redirect packets From: David Miller In-Reply-To: <5896f41165a82acf6e31f76562448de29940611b.1549476789.git.lorenzo.bianconi@redhat.com> References: <5896f41165a82acf6e31f76562448de29940611b.1549476789.git.lorenzo.bianconi@redhat.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 08 Feb 2019 21:50:55 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Lorenzo Bianconi Date: Wed, 6 Feb 2019 19:18:04 +0100 > According to the algorithm described in the comment block at the > beginning of ip_rt_send_redirect, the host should try to send > 'ip_rt_redirect_number' ICMP redirect packets with an exponential > backoff and then stop sending them at all assuming that the destination > ignores redirects. > If the device has previously sent some ICMP error packets that are > rate-limited (e.g TTL expired) and continues to receive traffic, > the redirect packets will never be transmitted. This happens since > peer->rate_tokens will be typically greater than 'ip_rt_redirect_number' > and so it will never be reset even if the redirect silence timeout > (ip_rt_redirect_silence) has elapsed without receiving any packet > requiring redirects. > > Fix it by using a dedicated counter for the number of ICMP redirect > packets that has been sent by the host > > I have not been able to identify a given commit that introduced the > issue since ip_rt_send_redirect implements the same rate-limiting > algorithm from commit 1da177e4c3f4 ("Linux-2.6.12-rc2") > > Signed-off-by: Lorenzo Bianconi Applied and queued up for -stable, thanks.