From patchwork Thu Oct 19 00:02:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 827870 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qF66galM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yHTcx2h79z9t3s for ; Thu, 19 Oct 2017 11:02:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbdJSACG (ORCPT ); Wed, 18 Oct 2017 20:02:06 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:48384 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbdJSACF (ORCPT ); Wed, 18 Oct 2017 20:02:05 -0400 Received: by mail-pf0-f194.google.com with SMTP id b79so5152968pfk.5 for ; Wed, 18 Oct 2017 17:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=e0hCMPqqSVjz7qU2p1ZPjMofADg8jK9ja80/JWP6+wg=; b=qF66galMoOQ+BroBQhUEC4dWf80d3McltDJBDYuBwypdKIf+MQcrOjdCxb8bFsoiKW WTUcscTUorYB5FJ5f3puFf5O616PJbyXUrX+c2qp0THoRBorjNN+MPVCenacTTL1XC// THBmK3QFXp4c9JfRDik532wsF7aaY+KhY1J6B+tE6QKwcrRP4p/p36VmG7gfARZbf3eK CIYo3NZqHOQRWZKR6Idj1Qk+eYyOoUvwbaokccimTOw+AtLsmS7fhuFC4LJBPimVzwwc y1vidzzfLjZ+k71EOv8JdLcmqTM/vUkcTIGJe1hf5ICyYiOT19JMQ29t/+mbwj3MdpGI 7u2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=e0hCMPqqSVjz7qU2p1ZPjMofADg8jK9ja80/JWP6+wg=; b=DkFhoDrka3FkP4sRajFu5LJYRiF9dMLRbEvVYuXV0aJ73BT/UDSELmLQBHncRZovmi 3vZfohY419ahvNOp4v2FJka7DOQGJ2XvBtLi/uppKUZvwf5HRHeDZyVOW0j7DdG2siql OvEzDQQIUpvCbIHV/OE5faONcD/nIILL6eklvcEKIPCbGuJ9UlIsCdYYeWEBPab763UA 7Rmr0AnIj/PNYbNvyJT9ZAhKKYQXRzEfi/M25GvF9opI9XVRAz8GkauJsLj3QA2s4ygq /BMu4Pnghedowjd41mcVIp9Q0cpqr7YP1MFFn8eJUN6lncN69A497XtWUJUhGU3rODXV c6Ng== X-Gm-Message-State: AMCzsaVnceVEKx8olwewn7lCR/9JBEKmUqYSSD+Zukmtfium+LcLJ9Uv dXQRU5ml6V1Y5lTmlBQfq+KhcQ== X-Google-Smtp-Source: ABhQp+TJO5CNoU+LUB8ZOqpsukuUxf8AOM4INJ+i5scPk5/leskcsfzOykrV6EnlMF7yFnLyz3+Lbw== X-Received: by 10.84.245.147 with SMTP id j19mr1630713pll.27.1508371325212; Wed, 18 Oct 2017 17:02:05 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:100:8c3b:83ae:17c4:e83? ([2620:15c:2c1:100:8c3b:83ae:17c4:e83]) by smtp.googlemail.com with ESMTPSA id t24sm24490420pfj.46.2017.10.18.17.02.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 17:02:03 -0700 (PDT) Message-ID: <1508371323.31614.156.camel@edumazet-glaptop3.roam.corp.google.com> Subject: [PATCH net-next] ipv4: ipv4_default_advmss() should use route mtu From: Eric Dumazet To: David Miller Cc: netdev Date: Wed, 18 Oct 2017 17:02:03 -0700 X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet ipv4_default_advmss() incorrectly uses the device MTU instead of the route provided one. IPv6 has the proper behavior, lets harmonize the two protocols. Signed-off-by: Eric Dumazet --- 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 4306db8273742f5e845635419c296823301c4a8b..bc40bd4111969f640603dd7c5b04fdb7fdcd4afd 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1250,7 +1250,7 @@ static void set_class_tag(struct rtable *rt, u32 tag) static unsigned int ipv4_default_advmss(const struct dst_entry *dst) { unsigned int header_size = sizeof(struct tcphdr) + sizeof(struct iphdr); - unsigned int advmss = max_t(unsigned int, dst->dev->mtu - header_size, + unsigned int advmss = max_t(unsigned int, ipv4_mtu(dst) - header_size, ip_rt_min_advmss); return min(advmss, IPV4_MAX_PMTU - header_size);