From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42374 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbcGMWjZ (ORCPT ); Wed, 13 Jul 2016 18:39:25 -0400 Subject: Patch "geneve: fix max_mtu setting" has been added to the 4.6-stable tree To: yanhaishuang@cmss.chinamobile.com, davem@davemloft.net, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 14 Jul 2016 07:39:10 +0900 Message-ID: <14684495501593@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled geneve: fix max_mtu setting to the 4.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: geneve-fix-max_mtu-setting.patch and it can be found in the queue-4.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Jul 14 07:36:41 JST 2016 From: Haishuang Yan Date: Sat, 2 Jul 2016 15:02:48 +0800 Subject: geneve: fix max_mtu setting From: Haishuang Yan [ Upstream commit d5d5e8d55732c7c35c354e45e3b0af2795978a57 ] For ipv6+udp+geneve encapsulation data, the max_mtu should subtract sizeof(ipv6hdr), instead of sizeof(iphdr). Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/geneve.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -1092,12 +1092,17 @@ static netdev_tx_t geneve_xmit(struct sk static int __geneve_change_mtu(struct net_device *dev, int new_mtu, bool strict) { + struct geneve_dev *geneve = netdev_priv(dev); /* The max_mtu calculation does not take account of GENEVE * options, to avoid excluding potentially valid * configurations. */ - int max_mtu = IP_MAX_MTU - GENEVE_BASE_HLEN - sizeof(struct iphdr) - - dev->hard_header_len; + int max_mtu = IP_MAX_MTU - GENEVE_BASE_HLEN - dev->hard_header_len; + + if (geneve->remote.sa.sa_family == AF_INET6) + max_mtu -= sizeof(struct ipv6hdr); + else + max_mtu -= sizeof(struct iphdr); if (new_mtu < 68) return -EINVAL; Patches currently in stable-queue which might be from yanhaishuang@cmss.chinamobile.com are queue-4.6/geneve-fix-max_mtu-setting.patch