From patchwork Wed Nov 23 12:14:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffen Klassert X-Patchwork-Id: 127288 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 4035AB6F8C for ; Wed, 23 Nov 2011 23:15:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754985Ab1KWMOz (ORCPT ); Wed, 23 Nov 2011 07:14:55 -0500 Received: from a.mx.secunet.com ([195.81.216.161]:53469 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754918Ab1KWMOy (ORCPT ); Wed, 23 Nov 2011 07:14:54 -0500 Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id D59A21A008A; Wed, 23 Nov 2011 13:14:53 +0100 (CET) X-Virus-Scanned: by secunet Received: from mail-srv1.secumail.de (unknown [10.53.40.200]) by a.mx.secunet.com (Postfix) with ESMTP id 891991A0080; Wed, 23 Nov 2011 13:14:51 +0100 (CET) Received: from gauss.dd.secunet.de ([10.182.7.102]) by mail-srv1.secumail.de with Microsoft SMTPSVC(6.0.3790.4675); Wed, 23 Nov 2011 13:14:51 +0100 Received: by gauss.dd.secunet.de (Postfix, from userid 1000) id 00AD45C048F; Wed, 23 Nov 2011 13:14:50 +0100 (CET) Date: Wed, 23 Nov 2011 13:14:50 +0100 From: Steffen Klassert To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 5/5] ipv4: Don't use the cached pmtu informations for input routes Message-ID: <20111123121450.GE6348@secunet.com> References: <20111123121213.GA6348@secunet.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20111123121213.GA6348@secunet.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 23 Nov 2011 12:14:51.0168 (UTC) FILETIME=[80419200:01CCA9D9] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The pmtu informations on the inetpeer are visible for output and input routes. On packet forwarding, we might propagate a learned pmtu to the sender. As we update the pmtu informations of the inetpeer on demand, the original sender of the forwarded packets might never notice when the pmtu to that inetpeer increases. So use the mtu of the outgoing device on packet forwarding instead of the pmtu to the final destination. Signed-off-by: Steffen Klassert --- net/ipv4/route.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 11d1b20..fb47c8f 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1816,15 +1816,15 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst) static unsigned int ipv4_mtu(const struct dst_entry *dst) { + const struct rtable *rt = (const struct rtable *) dst; unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); - if (mtu) + if (mtu && rt_is_output_route(rt)) return mtu; mtu = dst->dev->mtu; if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { - const struct rtable *rt = (const struct rtable *) dst; if (rt->rt_gateway != rt->rt_dst && mtu > 576) mtu = 576;