From patchwork Tue Feb 28 08:28:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li RongQing X-Patchwork-Id: 143374 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 E9798B6F62 for ; Tue, 28 Feb 2012 19:28:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756820Ab2B1I2h (ORCPT ); Tue, 28 Feb 2012 03:28:37 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:45207 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756364Ab2B1I2g (ORCPT ); Tue, 28 Feb 2012 03:28:36 -0500 Received: by yhmm54 with SMTP id m54so892149yhm.19 for ; Tue, 28 Feb 2012 00:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of roy.qing.li@gmail.com designates 10.236.77.166 as permitted sender) client-ip=10.236.77.166; Authentication-Results: mr.google.com; spf=pass (google.com: domain of roy.qing.li@gmail.com designates 10.236.77.166 as permitted sender) smtp.mail=roy.qing.li@gmail.com; dkim=pass header.i=roy.qing.li@gmail.com Received: from mr.google.com ([10.236.77.166]) by 10.236.77.166 with SMTP id d26mr26558319yhe.19.1330417715561 (num_hops = 1); Tue, 28 Feb 2012 00:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=1yMDq+KI0iGoC0msDkVjWWJ6folpbPRw7jvhE3o3bys=; b=l+mYcqirsKgZNU0/C4piuhrCXJV3oUB1k85bo1gigU3nwBEveXKzV8YSGfM9INaEDh SwfY8mViKYnu4IoLKyVXOjF3G8nFaUkX1Qzk5HkvIqnrT6nxgRjz8YC0BH260/5uDSJw TCThComrwZXqPjfOwXoDcEL/BUpxX6P6pIk/k= Received: by 10.236.77.166 with SMTP id d26mr19953015yhe.19.1330417715478; Tue, 28 Feb 2012 00:28:35 -0800 (PST) Received: from localhost ([61.148.56.138]) by mx.google.com with ESMTPS id p18sm25172353ano.20.2012.02.28.00.28.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Feb 2012 00:28:35 -0800 (PST) From: roy.qing.li@gmail.com To: netdev@vger.kernel.org Subject: [PATCH 2/2] ipv4: fix mss comparison Date: Tue, 28 Feb 2012 16:28:17 +0800 Message-Id: <1330417697-2637-2-git-send-email-roy.qing.li@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1330417697-2637-1-git-send-email-roy.qing.li@gmail.com> References: <1330417697-2637-1-git-send-email-roy.qing.li@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: RongQing.Li mss should compare with 65535 - sizeof(struct tcphdr), the largest mss is 65535 - sizeof(struct tcphdr). 40 is sum of sizeof(struct tcphdr) and sizeof(struct iphdr) Signed-off-by: RongQing.Li --- 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 0489ced..c72f765 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1914,8 +1914,8 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst) if (advmss == 0) { advmss = max_t(unsigned int, dst->dev->mtu - 40, ip_rt_min_advmss); - if (advmss > 65535 - 40) - advmss = 65535 - 40; + if (advmss > 65535 - sizeof(struct tcphdr)) + advmss = 65535 - sizeof(struct tcphdr); } return advmss; }