From patchwork Fri Feb 14 09:25:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duan Jiong X-Patchwork-Id: 320340 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 02A322C00AF for ; Fri, 14 Feb 2014 20:26:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbaBNJ0i (ORCPT ); Fri, 14 Feb 2014 04:26:38 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:36700 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751740AbaBNJ0f (ORCPT ); Fri, 14 Feb 2014 04:26:35 -0500 X-IronPort-AV: E=Sophos;i="4.95,843,1384272000"; d="scan'208";a="9527154" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 14 Feb 2014 17:22:44 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s1E9QVkl013673; Fri, 14 Feb 2014 17:26:32 +0800 Received: from [10.167.225.86] ([10.167.225.86]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014021417243089-6746 ; Fri, 14 Feb 2014 17:24:30 +0800 Message-ID: <52FDE10F.5010903@cn.fujitsu.com> Date: Fri, 14 Feb 2014 17:25:35 +0800 From: Duan Jiong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: David Miller CC: netdev , hannes@stressinduktion.org Subject: [PATCH] ipv4: use daddr to get inet_peer X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/02/14 17:24:30, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/02/14 17:24:32, Serialize complete at 2014/02/14 17:24:32 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org since commit 1d861aa4("inet: Minimize use of cached route inetpeer"), ip_error() uses saddr to get inet_peer, so ip_error() and icmpv4_xrlim_allow() use the same inet_peer to limit icmp error message twice. In ip_error(), peer->rate_tokens is set to ip_rt_error_burst, but in inet_peer_xrlim_allow() peer->rate_tokens is set to XRLIM_BURST_FACTOR. XRLIM_BURST_FACTOR is defined to 6, so user seting ip_rt_error_burst makes no sense. In my opinion, the ip_rt_error_burst is used to limit icmp error messages for daddr instead of saddr. Signed-off-by: Duan Jiong --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 25071b4..4da5588 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -933,7 +933,7 @@ static int ip_error(struct sk_buff *skb) break; } - peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr, 1); + peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->daddr, 1); send = true; if (peer) {